Comments (8)
I am working with this dataset https://www.kaggle.com/nischallal/rice-disease-dataset
from pylabel.
Thank you.
I checked the Yolo documentation and they support all of the image types "bmp, jpg, jpeg, png, tif, tiff, dng, webp, mpo"
I think the best fix would be to let the img_ext param take a comma seperated list like "bmp, jpg, jpeg, png, tif, tiff, dng, webp, mpo" and then check for any of those files until it finds a match.
I think I could work on the change and release a new version this weekend.
Or you are welcome to try and make the change yourself and make a pull request.
The change needs to be made in https://github.com/pylabel-project/pylabel/blob/dev/pylabel/importer.py around line 310
row["img_folder"] = path_to_images
row["img_filename"] = filename.name.replace("txt", img_ext)
# Get the path to the image file to extract the height, width, and depth
image_path = PurePath(path, path_to_images, row["img_filename"])`
from pylabel.
Hello @dnth I have released a new version [v0.1.32] with support for multiple file types. Please give it a try!
from pylabel.
Hello @dnth, it doesn't work for multiple file types right now because they way it works is:
- Look for <image_x>.txt annotation file
- Look for an image in the path ../images/<image_x>.<image_ext>
I can think of a some solutions. Let me know what you think would make the most sense:
- Allow user to specify multiple file extension, then the code will check multiple file types and use the first one that it finds a match for. For example first check for <image_x>.jpg , if it doesn't find it, check for <image_x>.png. (I think this could be a little slow)
- Instead of look at the annotations and then look for the image, reverse and look for all the image files and then look for an annotation file. I think this might be cleaner, but it could have problems if there are extra images without annotations files.
Also would it be possible for you to share your dataset so I could use it for testing whatever solution we can come up with.
from pylabel.
img_ext (str, comma separated): Specify the file extension(s) of the images used in your dataset:
.jpeg, .png, etc. This is required because the YOLO format does not store the filename of the images.
It could be any of the image formats supported by YoloV5. PyLabel will iterate through the file extensions
specified until it finds a match.
from pylabel.
Thanks @alexheat! The conversion works now. However, I found another issue: there are files with the same filename in different folders.
Eg. valid/blast_orig_001.jpg
and test/blast_orig_001.jpg
because of this I suspect the annotations were mixed up.
This is the result of the conversion
from pylabel.
Hi @dnth , yes I think there can be issue is the image names are not unique. That particular dataset looks like it has the same image in more than one split, which doesn't seem like a good thing to do in general.
Can you share the code that you used to import the data set and create the image in the screenshot?
Also I am curious what you are trying to do the with the dataset in general. Would you tell me more about your project?
Thanks! Alex
from pylabel.
I would like to make an object detector model that can recognize disease on rice leaves. This is one dataset i found that comes with bbox annotations. I agree that the dataset might not be properly curated with the overlapping names. I should probably spend time to clean them up first i guess..
This is the repo to the codes I was using to generate the above screenshot
https://github.com/dnth/paddy_disease_detection/blob/main/convert_data.ipynb
from pylabel.
Related Issues (20)
- Crash when converting an image from COCO to YOLO that has no annotation in it HOT 1
- AttributeError: 'DataFrame' object has no attribute 'append' HOT 4
- is CreateML json format supported? HOT 5
- Error when i transform a COCO dataset to a YOLO dataset with segmentation = true and cat_id_index = 0 HOT 3
- It's possible to import YOLO segmentation dataset? HOT 2
- Annotation ids in '/content/test/img/coco128.json' are not unique! HOT 1
- StratifiedGroupShuffleSplit results in Empty DataFrame HOT 3
- yolo class label is unsorted HOT 1
- cat_id_index for yolov5 to coco format HOT 1
- how to edit yolo label with imported txt labels ? HOT 1
- UnboundLocalError: local variable 'categories' referenced before assignment HOT 2
- how to split YOLO datasets to train/val. Not train/val/test HOT 1
- Verbosity or progress bar HOT 5
- AssertionError: Output shape does not match input shape. Data loss has occured. HOT 4
- ShowClassSplits returning empty dataframe for YoloV5
- Class categories not correct after conversion from coco to yolo format. HOT 3
- Add tqdm to setup.py HOT 2
- Update Readme examples HOT 1
- Issue using both segmentation=True and cat_id_index=0 HOT 2
- YOLOv5 class index starts from 1 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pylabel.