https://github.com/monajemi-arman/object-detection-utils
Utility scripts used in object detection model training and testing
https://github.com/monajemi-arman/object-detection-utils
coco data-visualization dataset-visualizer deep-learning object-detection visualizer yolo
Last synced: 15 days ago
JSON representation
Utility scripts used in object detection model training and testing
- Host: GitHub
- URL: https://github.com/monajemi-arman/object-detection-utils
- Owner: monajemi-arman
- License: mit
- Created: 2024-09-08T09:17:14.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-08-21T13:34:56.000Z (10 months ago)
- Last Synced: 2025-08-21T15:46:24.361Z (10 months ago)
- Topics: coco, data-visualization, dataset-visualizer, deep-learning, object-detection, visualizer, yolo
- Language: Python
- Homepage:
- Size: 152 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Object Detection Utils
* Utility scripts used in object detection model training and testing
* Utility functions and classes are easy to import in your projects
# Requirements
Before using any of the tools, install requirements:
```bash
pip install -r requirements.txt
```
# List of Tools
## Visualizer
Visualize standardized object detection datasets
## Features
* Support COCO and YOLO style dataset
* Live search for files
### COCO Style dataset
```bash
python visualizer.py -m coco -d train/images -l train.json
```
## YOLO Style dataset
```bash
python visualizer.py -m yolo -d train/images -l train/labels
```
Choose image | Visualize
:-------------------------:|:-------------------------:
 | 
## YOLO to COCO Converter
A simple script to convert YOLO annotations to COCO format.
### Usage
```bash
python yolo_to_coco.py
```
* : Directory with YOLO .txt files.
* : Directory with corresponding images.
* : Output COCO JSON file.
## COCO to YOLO Converter
A simple script to convert YOLO annotations to COCO format.
### Usage
```bash
python coco_to_yolo.py -c -i -o
```
* : Path to COCO annotations JSON file.
* : Directory with corresponding images.
* : Path to output yolo labels directory path.
## Histogram
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
### Usage
```bash
python histogram.py
```
## COCO Metrics
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:
```json
"annotations": [
{
"id": 0,
"image_id": 0,
"category_id": 0,
"bbox": [...], // bounding box coordinates according to COCO format
"score": 0.9994403719902039
},
...
]
```
### Usage
```bash
python coco_metrics.py predictions.json # Your predictions JSON
```
## COCO split train / validation / test set
You 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)
```bash
python coco_split_train_val_test.py labels.json # Your labels JSON
```
## COCO Multi to Single Class
Sometimes you need to convert your multi-class object detection COCO JSON into a single-class COCO JSON. All categories of objects squashed into one.
### Usage
```bash
python coco_multi_to_single_class.py labels.json # Your COCO-style JSON
```