-
Notifications
You must be signed in to change notification settings - Fork 460
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
Thumbnail Handling #149
Thumbnail Handling #149
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution!
To enable generation of the image when import COCO, the image flag would have to be set here. As for generating a thumbnail with no annotations should already be handled the way it is currently setup.
I've made quite a few changes, take a look, test it out and let me know. |
I have to change the flag method, the previous version always calculates the thumbnail, it seems to be the flag, so now is not automatically change, you have to pass the new value to the method, now it works. Also, there is a crash when I delete and image and then I go to the Undo tab, it crashes, look the error message: The line numbers match with this finale version. Seems like the image is deleted before undo. |
Ready, let me know about the bug and other corrections on the code. |
@jsbroks Hi, did you update the docker image with this feature? I have updated my version and it doesn't store the thumbnails. |
Which build image are you using? I haven't pushed it to the stable tag yet, only latest. |
How can I check that? (sorry) |
In the |
Hi @jsbroks
This is the patch for the thumbnail handling, I try to be clean and organized taking into account that is not my code, so I had to figure out where to make the changes, this includes the git and docker ignores and paths to the config file and database.
This is how works:
When you a new dataset, a new folder is created in the folder
/thumbnails
with the dataset name, to handle the deletions easily.When you create a new annotation, the next time you load the dataset, the thumbnail will be created and store at the corresponding path using the
id
.I include the flag
is_modified
inImageModel
, this flag lights up when a new annotation is made on a image already with annotations, this force to calculate the thumbnail again, maintaining the feature of previewing the annotations.When any annotation is deleted, the thumbnail image is deleted from the folder, this covers to cases, when the image has no more annotations, the image must be deleted in order to keep space in disk; or when the image has more annotations forcing to get a new image.
I add into
undo.py
the cascade delete for the thumbnails when a image is deleted, also I fixed the bug when you delete a dataset and the folder remains in disk (/datasets
), the deletion of thumbnails at dataset level is included as well.I made two new methods in
ImageModel
to handle this feature.This is a first approach, maybe is more convenient make some changes in other files, I'm not sure. Other features pro performance could be:
Thanks.
EDIT: Note that the thumbnail is not make automatically when you import coco annotations, also when the image has no annotations available, it's important to cover these situations, can you guide me where to do it?
Resolves #92