Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version #2

Open
Love-Studyyy opened this issue Jun 23, 2021 · 15 comments
Open

version #2

Love-Studyyy opened this issue Jun 23, 2021 · 15 comments

Comments

@Love-Studyyy
Copy link

Can you list the corresponding version of dependent packages?
I guess it influences a lot.

@sudecki30
Copy link
Owner

Hi, I will answer you today or tomorrow 😉

@Love-Studyyy
Copy link
Author

Hi, thank you very much! It is very helpful!
I’ve successfully converted png to json the day before yesterday morning.
But I messed version of packages.
It's been a failure till now

@Love-Studyyy
Copy link
Author

“cv.findcontours” can't find contours and hierarchy return "(0,0,0,0)"

@sudecki30
Copy link
Owner

What is your data collection?

@Love-Studyyy
Copy link
Author

png images are 8-bit depth gray images
jpeg images are 24-bit depth RGB images

@sudecki30
Copy link
Owner

sudecki30 commented Jun 23, 2021

To correct this, “cv.findcontours” can't find contours and hierarchy return "(0,0,0,0)", are you modified correctly the json file "parameter", with the correct level of grey (in color option of each labels? Because my code work normally on RGB images as png

@Love-Studyyy
Copy link
Author

Do you mean png images are RGB format?

@sudecki30
Copy link
Owner

yes one of my png
aachen_000000_000019

@sudecki30
Copy link
Owner

sudecki30 commented Jun 23, 2021

each color is a label, you can in grey, but you need to define each label to correspond at an intensity of grey (warning, it is not turple of value but 1D in json files if you use grey color)

to test easilier, you can comment the two last line of the code and use :" # for j in range(l):
image_to_json_partial(j)"

@sudecki30
Copy link
Owner

A solution for you if intensity of grey = the label number mask=(image_label == category_id).all(-1)

@Love-Studyyy
Copy link
Author

You are so enthusiastic!
Thank you very much!
I'm trying!

@sudecki30
Copy link
Owner

BE careful, i know, for example the png of citymap have a little image frame around, if it is it, you need to resize image of label and jpeg before to delete it. (it can explain the error you get “cv.findcontours” can't find contours and hierarchy return "(0,0,0,0)")

Good luck

@Love-Studyyy
Copy link
Author

ok, thanks a lot!
And the version of packages can you list?😉 like: opencv, numpy, shapely ..

@sudecki30
Copy link
Owner

numpy 1.20.2
opencv-python 4.5.2.54
python 3.8.10
scipy 1.7.0
scikit-image 0.18.1
shapely 1.7.1
tqdm 4.61.1

I have updated the code, now it works with updated package

@Love-Studyyy
Copy link
Author

Thank you so much!😉
you are very enthusiastic and patient!
good luck to you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants