- Utility scripts used in object detection model training and testing
- Utility functions and classes are easy to import in your projects
Before using any of the tools, install requirements:
pip install -r requirements.txtVisualize standardized object detection datasets
- Support COCO and YOLO style dataset
- Live search for files
python visualizer.py -m coco -d train/images -l train.json python visualizer.py -m yolo -d train/images -l train/labels | Choose image | Visualize |
|---|---|
![]() |
![]() |
A simple script to convert YOLO annotations to COCO format.
python yolo_to_coco.py <yolo_annotations> <image_dir> <output_file>- <yolo_annotations>: Directory with YOLO .txt files.
- <image_dir>: Directory with corresponding images.
- <output_file>: Output COCO JSON file.
A simple script to convert YOLO annotations to COCO format.
python coco_to_yolo.py -c <coco_annotation_json> -i <image_dir> -o <output_labels_path>- <coco_annotation_json>: Path to COCO annotations JSON file.
- <image_dir>: Directory with corresponding images.
- <output_labels_path>: Path to output yolo labels directory path.
Draw histogram of colored or grey images
- Support medical DICOM image format
- Support PNG / JPEG
- Auto-detect colored / grey images
- Hover on chart to get exact pixel intensity values
python histogram.py <image_path>Calculate metrics using an output JSON containing your model predictions in COCO format. The metrics calculated include mAP (Mean Average Precison).
Your output JSON has annotations in this format:
"annotations": [
{
"id": 0,
"image_id": 0,
"category_id": 0,
"bbox": [...], // bounding box coordinates according to COCO format
"score": 0.9994403719902039
},
...
]python coco_metrics.py predictions.json # Your predictions JSONYou may happen to forget to split your database into train / validation /test set, in that case you may use this script to split a single labels.json into train.json, val.json, and test.json. (no need to split images folder, JSON would suffice)
python coco_split_train_val_test.py labels.json # Your labels JSONSometimes you need to convert your multi-class object detection COCO JSON into a single-class COCO JSON. All categories of objects squashed into one.
python coco_multi_to_single_class.py labels.json # Your COCO-style JSON
