-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Images uploaded via the SDK are twice as large as those uploaded via the web interface #6878
Comments
Try to turn off the Prefer zip chunks toggle. |
My problem (double image size) occurs when uploading images with the SDK, not with the web interface. I have tried to upload the images (via sdk, api) without the zip chunks option and the problem persists. |
Also observing this issue but with manifest files. I found that this happens if the file size is above 2.5Mb. In this case django starts to use It appears that the file is written to disk first time by When the size is below 2.5Mb ( The workaround I'm going to use now is to increase the |
Increasing the |
Thank you very much for the answer, but where can I find this variable? |
This variable is part of Django setting: https://docs.djangoproject.com/en/4.2/ref/settings/. I used approach described here to overwrite it: https://opencv.github.io/cvat/docs/administration/advanced/ldap/ But used from cvat.settings.production import *
FILE_UPLOAD_MAX_MEMORY_SIZE = 100 * 1024 * 1024 The services:
cvat_server:
environment:
DJANGO_SETTINGS_MODULE: settings
volumes:
- ./settings.py:/home/django/settings.py:ro |
Would it be the same to add it to the current DJANGO settings file in CVAT? FILE_UPLOAD_MAX_MEMORY_SIZE = 200 * 1024 * 1024 But I still have the same problem. Anyway, I don't understand why it would be something about this configuration, as I only see the problem if I upload images through the SDK, but not through the web interface. |
Yes, should be the same. I'm not sure if the issue is the same with images. I observed double file size for |
OK, so that solution didn't work for me. Thank you very much for your help! |
More information and experiments:
This might indicate that it must be related not to the size of the file itself, but to the size of the set of uploaded images. I have been doing a lot of tests and, as @dm0 said, this is happening when exceeding 2.5 MB. That is, if the file or set of files is less than 2.5MB, there is no problem. If it exceeds 2.5MB, all the files become duplicated in size. By the way, @dm0 maybe your solution isn't working for me because I'm not doing it right. After editing the file, what commands should I run? Thank you very much for your help. |
It depends on how you run CVAT and edit the file. If you'r using docker compose and edit the file in the container then I believe it should be enough to restart the If just edit the settings file in your local copy of the CVAT repository and then use By the way, I checked with a single 23Mb image this way: cvat-cli create "test" --project_id 1 local 23m.png And the file size appears to be duplicated (with the CVAT 2.7.1 without additional setup): # ls -lh /home/django/data/data/56/raw/
total 45M
-rw-r--r-- 1 django django 45M Sep 21 08:45 23m.png Assuming CVAT is not running (
Then the file size is expected: # ls -lh /home/django/data/data/57/raw/
total 23M
-rw-r--r-- 1 django django 23M Sep 21 08:51 23m.png |
@dm0 Following your steps my problem is solved! Thank you very much for your help. Anyway, I think this is a bug and must be solved, so I don't close the issue waiting for a developer to see it. |
Thanks for the report, we will take a look. |
…ltiple requests (#6952) Fixes #6878 In the case of big files (>2.5 MB by default), the uploaded files could be write-appended twice, leading to bigger raw file sizes than expected. This PR fixes the behavior by excluding repetitive writes where it was not supposed. - Fixed double append-writing of the uploaded files when Upload-Multiple requests are used - Fixed potential DB - disk inconsistencies in the case of upload errors - Added tests
…ltiple requests (cvat-ai#6952) Fixes cvat-ai#6878 In the case of big files (>2.5 MB by default), the uploaded files could be write-appended twice, leading to bigger raw file sizes than expected. This PR fixes the behavior by excluding repetitive writes where it was not supposed. - Fixed double append-writing of the uploaded files when Upload-Multiple requests are used - Fixed potential DB - disk inconsistencies in the case of upload errors - Added tests
My actions before raising this issue
Steps to Reproduce (for bugs)
Current Behaviour
I am creating tasks and uploading images programmatically, but I realized that a project I expected to be 20 GB in size was finally 40 GB. Initially, I thought it might be because of parameters like zip_chunks or cache, but it's not.
I selected three images of 77.6MB, 56.9MB, and 42.8MB, created a CVAT task from the web interface, and uploaded these images. I have done the same process but with the SDK, and as a result, I can see that the images uploaded with the SDK occupy twice as much space in the docker volume.
This is the configuration used in the web interface:
This is the configuration used in SDK:
This is the comparison of size between task created in web interface (253) and task created using the SDK (255):
Is it a bug or am I missing a parameter?
Your Environment
docker version
(e.g. Docker 17.0.05): 20.10.25The text was updated successfully, but these errors were encountered: