-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[GSoC2024] Resolved issue #7523: Fixed error caused by filenames with same names #7602
Closed
Closed
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b3bfaf7
Resolved issue #7523: Fixed error caused by filenames with the same n…
98f6e02
Merge branch 'opencv:develop' into develop
adkbbx a7714b2
Reverse mapping instance_data._frame_mapping
87d6a18
updated import_dm_annotation function
638d3e0
appended extensions in _frame_mapping
dc91b3e
Merge branch 'opencv:develop' into develop
adkbbx 18135e0
updated match_frame_fuzzy
9505262
Merge branch 'develop' into develop
zhiltsov-max 51972f0
Merge branch 'opencv:develop' into develop
adkbbx d6763af
Merge branch 'opencv:develop' into develop
adkbbx 6190bd2
Merge branch 'opencv:develop' into develop
adkbbx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Could you please try to implement the solution I described in #7523 (comment)? This code currently misses the most important part, that, in fact, should address the problem. Currently, as I see, the code doesn't change the situation, as it just modifies the input dataset and then changes everything back on the Datumaro side. As the problem is on the Datumaro side, it's not possible to solve it just by changing the Datumaro dataset object. Please also check the zip archive case as well, and then COCO Keypoints format in this file, it will have the same implementation for the fix.
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.
@zhiltsov-max
I've been experimenting with the implementation provided in #7523(comment), and I encountered a circular import error while attempting to load the rename_mapping variable into bindings.py.
ImportError: cannot import name 'GetCVATDataExtractor' from partially initialized module 'cvat.apps.dataset_manager.bindings' (most likely due to a circular import) (/home/adkbbx/projects/CVAT/cvat/cvat/apps/dataset_manager/bindings.py)
Which I thought would be the way of implementing this logic please do correct me if I was wrong with the implementation.
On furthur debugging I found that the
self._frame_mapping
variable inside the bindings.py only contains the value{"image1": 1}
may be since same keys were used since path "Image1" was same for both the images in the dataset and only the value of fram got update from 0->1 which I felt would be the cause of multiple annotations being placed on the same image on my current implementation.To resolve this, I attempted to updating the _frame_mapping attribute with the instance_data and this seems to resolve the issue of multiple annotations being placed on the same image on my current implementation but while I was testing the export of datasets the annotations aren't getting updated into json file.
"annotations": []
So I think updating _frame_mapping might be the cause of this export error which I am unable to debug.
I would appreciate any hints, insights or suggestions for the implementation of this solution further. I'm sorry for the frequent contact and thank you for your time and patience! 🙇
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.
The suggestion in the comment was to add a new function parameter to
import_dm_annotations()
inbindings.py
. I believe, this doesn't require importing any modules. Then, you can supply the constructed mapping into this function, when it's called incoco.py
. After this, inimport_dm_annotations()
, thematch_dm_item()
function gets called. It also needs a new parameter.match_dm_item()
needs to be updated to use this new parameter to map the item name back into the original one, and find the matching frame id in the job or task.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.
@zhiltsov-max
I've pushed a new commit attempting to address the issue and think I was able to incorporated the suggestions you provided earlier, including adding a new parameter to import_dm_annotations() in bindings.py and updating match_dm_item() accordingly. Despite these changes, It seems that the annotations are still being duplicated on some images even though the anotations are being accepted now. As of what I am able to understand from my debugging the way
instance_dataset._frame_mapping
updates when there are images with same name and different extensions might be the cause of this issue.Any further guidance you can provide would be greatly appreciated. Thank you for your continued support and feedback.
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.
That's very nice to see advances in solving this problem.
Yeah, it seems to be the issue now. From what I've checked, we can try to change what's stored in these frame mappings, as they seem to only be used for frame matching. Probably, we can include file extensions in these mappings as well.
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.
Please try to check server logs with
docker logs test_cvat_server_1
,docker logs test_cvat_worker_import_1
,docker logs test_cvat_worker_export_1
. You can also attach a debugger, if it's needed.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.
@zhiltsov-max I am sorry I think that was a mistake from me I will update the tests and check the logs as requested thank you!
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.
Hi, any updates?
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.
@zhiltsov-max I am sorry for the delayed response and must inform you that progress on this task has been slower than anticipated since I had been a little busy with the proposal submission for GSOC. I plan to complete working on this issue as soon as possible. I apologize for any inconvenience this may have caused, and I assure you that I am dedicated to completing this task promptly and effectively. Thank you for your understanding and continued support. 🙇
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.
Ok, do as you see fits best to you, it's your PR after all. Just keep in mind the program deadlines, if you want it to be a part of GSoC.