cvat
cvat copied to clipboard
ValueError: could not convert string to float
Actions before raising this issue
- [X] I searched the existing issues and did not find anything similar.
- [X] I read/searched the docs
Steps to Reproduce
- Try to upload .mpv video file which has decimal comma in the metadata
- import fails with the error:
Could not create the task
Error: Could not create the task on the server. ValueError: could not convert string to float: '44,877000000'.
Expected Behavior
Import should succeed
Possible Solution
sed -i 's|float(_sec)|float(_sec.replace(",","."))|g' cvat/apps/engine/media_extractors.py
for example: https://github.com/opencv/cvat/pull/6923
Context
Happens with mkv video exported from Networkoptix NX Witness VMS software. Works correctly for avi format.
Environment
v2.4.4 tag in the container run via docker-compose
I think this is a pretty straightforward fix. Should I go ahead and write a solution @nmanovic ?
I plan to change cvat/apps/engine/media_extractors.py
so that the commas are replaced by dots
@ChanBong , please try to reproduce the issue first. It looks like the number of seconds can be encoded differently (depends on locale?). Need to understand what DURATION should have and how to decode it properly. I don't think it is right to replace ',' by a '.'. I'm not sure it will work always. Need to reproduce and understand the reason behind the problem.
You are right. This depends on the local encoding, mostly on your local computer language. I wasn't able to get/make such a video with commas in the duration. Maybe if @gronki can provide such video