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

ValueError: cannot reshape array of size 9 into shape (4,2) #15

Open
imadgohar opened this issue Jul 10, 2023 · 0 comments
Open

ValueError: cannot reshape array of size 9 into shape (4,2) #15

imadgohar opened this issue Jul 10, 2023 · 0 comments

Comments

@imadgohar
Copy link

@ming71
I am using your this toolbox to augment my DOTA type custom dataset. The environment is all set on windows 10 server with anaconda environment.

After running the code I am getting the following error. As DOTA has 10 values in annotation file "x1 y1 x2 y2 x3 y3 x4 y4 class category"

The error is in the function below, as we have 10 values 0-9 in the array I also did change the reshape(5, 2) but again error.
def bbox_area(bbox):
bbox = np.asarray(bbox)
bbox = np.array(bbox).reshape(4, 2)
poly = Polygon(bbox).convex_hull
return poly.area

Can you please guide me through what is going wrong here? @Captain1986
ming

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

1 participant