cvat icon indicating copy to clipboard operation
cvat copied to clipboard

ValueError: could not convert string to float

Open gronki opened this issue 1 year ago • 3 comments

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

  1. Try to upload .mpv video file which has decimal comma in the metadata
  2. 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

gronki avatar Oct 06 '23 16:10 gronki

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 avatar Apr 09 '24 17:04 ChanBong

@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.

nmanovic avatar Apr 09 '24 19:04 nmanovic

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

ChanBong avatar Apr 11 '24 03:04 ChanBong