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

resizing the color masks somehow messes the color detection #35

Closed
tanmaypandey7 opened this issue Apr 1, 2019 · 3 comments
Closed

Comments

@tanmaypandey7
Copy link

hi, i have labelled around 300 images for my training dataset. unfortunately since i was getting a out of memory error i had to resize all of them including the masks. but when i run a pixel color detection script the resized image detects multiple labels whereas the original ones only show a single color.
note that all my images have 1 label only, i have no idea why it is doing so.
i'll attach some images for referenece.
original images :
2653005010666-1
3021690011258-10
3021760290057-1
3021760290422-1
3021760291047-1
2600438012149-1
resized ones:
2653005010666-1
3021690011258-10
3021760290057-1
3021760290422-1
3021760291047-1
2600438012149-1

while pixel_color_detecting the original images:
Screenshot (42)

while for resized:
Screenshot (43)

@abreheret
Copy link
Owner

Your issue has nothing to do with Pixel Annotation tools (so I close the issue).
In addition :

  • you do not provide your resize script
  • I dont see the difference between the original image and resize image (the sizes are the same)

But in view of your images, it seems to me that you need (in your script to resize) use a CUBIC or LINEAR interpolation, and therefore the labels border are "averaged". It is necessary to use an interpolation of the NEAREST type.

@tanmaypandey7
Copy link
Author

since i am a noob at markdown here is the script:
just adding a imgur link to make code a bit understandable
https://imgur.com/K5vc8D1

@tanmaypandey7
Copy link
Author

thank you, dear sir, simply changing cv2.INTER_AREA TO cv2.INTER_NEAREST did the trick. I cannot thank you enough as you have saved me from labeling 500 images again.

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