Invert BDD100 dataset to YOLO dataset
Project description
BDD100_TO_YOLO
Introduction
Invert bdd100 dataset to yolo dataset and fix dataset
Preparation
pip install bdd100-to-yolo
Example
#import modules
from bdd100_to_yolo import bdd100_to_yolo
#BD100k original image file path, BD100k original label file path and the path saving inverted label files
images_train_path = "bd100/images/train"
images_val_path = "bdd100/images/val"
labels_train_path = "bdd100_labels/det_train.json"
labels_val_path = "bdd100_labels/det_val.json"
labels_train_save_path = "bdd100/labels/train"
labels_val_save_path = "bdd100/labels/val"
'''
It is feasible to delete some lables you do not want or shuffle the list below,
"pederstrain" corresponds class number 0, "car" corresponds class number 1 and the next follws the same rules as above.
'''
classes = [
"pedestrian",
# "rider",
"car",
"truck",
#"bus",
# "train",
"motorcycle",
"bicycle",
"traffic light",
"traffic sign"
]
#Invert DBB100json to YOLO txt
bdd100_to_yolo.dataset_invert(images_train_path, labels_train_path, labels_train_save_path, classes)
bdd100_to_yolo.dataset_invert(images_val_path, labels_val_path, labels_val_save_path, classes)
'''
Some image files may not have corresponding label files,
so it is necessary to clear the invalid data.
Warning that you must invert all dbb100 json files to yolo txt file at first and then fixing the dataset.
BDD100K has 10 000 images so it may take 1 - 3 hours to fix the dataset.
'''
bdd100_to_yolo.dataset_fix(images_train_path, labels_train_save_path)
bdd100_to_yolo.dataset_fix(images_val_path, labels_val_save_path)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bdd100_to_yolo-0.0.3.tar.gz
(3.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bdd100_to_yolo-0.0.3.tar.gz.
File metadata
- Download URL: bdd100_to_yolo-0.0.3.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e44e9d4246f27ccdd7a18c7330973635d6615dbff2560bb862ca64be6402230
|
|
| MD5 |
2d819e88196d8945f05bb2496da38dba
|
|
| BLAKE2b-256 |
70c724dfc63c981992ebcea3a0f43ca426683995d71170a4d9a6e02097698441
|
File details
Details for the file bdd100_to_yolo-0.0.3-py3-none-any.whl.
File metadata
- Download URL: bdd100_to_yolo-0.0.3-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3608dd8a4741f0b58b00adc40653255eaed2c9ecf5a9651d81f5afd871b5fa01
|
|
| MD5 |
caad5b7d736041cc728c4d710b06723a
|
|
| BLAKE2b-256 |
df512b8d925d2aac818be3d765902ea3bc45a670eb628eb8030925b086e1707b
|