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

The bounding box values are wrong #40

Closed
ajaysurya1221 opened this issue Nov 21, 2020 · 2 comments
Closed

The bounding box values are wrong #40

ajaysurya1221 opened this issue Nov 21, 2020 · 2 comments

Comments

@ajaysurya1221
Copy link

Hi,
I completed my annotation and had a look at the .txt files. All the values of my bounding boxes start with 0.

For eg :
0 0.485048 0.334155 0.253589 0.059186
1 0.449761 0.529593 0.180622 0.060419
2 0.437799 0.739211 0.153110 0.053021
3 0.550239 0.215783 0.250000 0.054254
This is for a single image with 4 classes.

I used PIL and OpenCV to crop my image using these values considering they are [xmin ymin xmax ymax] and I got the results wrong. When I reopen Yolo_Label, the boxes are perfectly there. Is there anything I need to do? any solution?

The code I used to crop the boxes :

from PIL import Image
import matplotlib.pyplot as plt
bbox=(int(0.485048), int(0.334155), int(0.253589), int(0.059186)) #for one bounding box of an image
im=Image.open('sample.jpg')
im=im.crop(bbox)
plt.subplot(3,3,i+1)
plt.axis("off")
plt.imshow(im)

@developer0hye
Copy link
Owner

Refer to #39 (comment)

@ajaysurya1221
Copy link
Author

Thank you so much

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