Skip to content

Conversation

@AnTaRes27
Copy link

@AnTaRes27 AnTaRes27 commented Nov 20, 2024

Annotation script will reject frames that are too similar to try and minimise duplicates to encourage more varied data.
Works by using opencv's template matching to compare the most recent frame loaded against the previous few frames that was saved. If they're too similar, it'll reject it and move on to the next. Otherwise it'll save. This does increase initial processing time quite significantly, though. From my testing, out of 1600 frames, it spits out 400ish good frames. But 400 varied frames :>

SIMILARITY_LOOKBACK_COUNT sets how many previous images to compare it with.
SIMILARITY_THRESHOLD sets the template matching threshold. 0.99 seems to be nice starting point.

Also added some hints/overlay when annotating and also keyboard shortcut hints as footer. Saved points are clamped to the image size even if somehow someone managed to put an annotation point on the footer.

Another feature added was ability to go backwards in the list of images. If i make a mistake I can just go back and edit the points and save.

And last thing i added was rotating image while annotating. Helps when annotating (helps with my pattern recognising monkey brain) but im sure i haven't handled edge cases sooooooooo
The data is still saved in its original form though, as if nothing was rotated in the first place.

image
image
image

need to explicitly limit python ver to <3.13 to keep pyinstaller v5. not sure if you want to bump that or not
uses cv2 template matching to compare against previous frames and skips saving frames that are too similar
grabbed the point placement hints from the dev updates post. kboard shortcut hints from the print statement above
@AnTaRes27
Copy link
Author

I think a lot of changes are also due to ruff, a lot of deletions in the poetry lock file just cuz they weren't in the pyproject.toml

i make mistakes a lot when annotating XD
@AnTaRes27 AnTaRes27 changed the title Reject Similar Frames + Minor UI Improvements Reject Similar Frames + UI Improvements Nov 20, 2024
@cquinlan
Copy link

I agree with the dog

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

Successfully merging this pull request may close these issues.

2 participants