Coder Social home page Coder Social logo

Comments (8)

dnth avatar dnth commented on May 20, 2024 1

I am working with this dataset https://www.kaggle.com/nischallal/rice-disease-dataset

from pylabel.

alexheat avatar alexheat commented on May 20, 2024 1

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.

alexheat avatar alexheat commented on May 20, 2024 1

Hello @dnth I have released a new version [v0.1.32] with support for multiple file types. Please give it a try!

from pylabel.

alexheat avatar alexheat commented on May 20, 2024

Hello @dnth, it doesn't work for multiple file types right now because they way it works is:

  1. Look for <image_x>.txt annotation file
  2. 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:

  1. 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)
  2. 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.

alexheat avatar alexheat commented on May 20, 2024

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.

dnth avatar dnth commented on May 20, 2024

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
image

from pylabel.

alexheat avatar alexheat commented on May 20, 2024

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.

dnth avatar dnth commented on May 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.