You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[5778](https://file+.vscode-resource.vscode-cdn.net/home/cystodev1/code/cystoaid_data_pipline/~/.local/lib/python3.10/site-packages/fiftyone/utils/cvat.py:5778) print(f'5770:anno_type: {anno_type}, prev_frame: {prev_frame}, prev_outside: {prev_outside}')
[5779](https://file+.vscode-resource.vscode-cdn.net/home/cystodev1/code/cystoaid_data_pipline/~/.local/lib/python3.10/site-packages/fiftyone/utils/cvat.py:5779) if (anno_type == "track" and prev_frame is not None and not prev_outside):
-> [5780](https://file+.vscode-resource.vscode-cdn.net/home/cystodev1/code/cystoaid_data_pipline/~/.local/lib/python3.10/site-packages/fiftyone/utils/cvat.py:5780) for frame in range( prev_frame + 1, min(max(frame_id_map), frame_stop) + 1 ):
[5781](https://file+.vscode-resource.vscode-cdn.net/home/cystodev1/code/cystoaid_data_pipline/~/.local/lib/python3.10/site-packages/fiftyone/utils/cvat.py:5781) anno = deepcopy(prev_anno)
[5782](https://file+.vscode-resource.vscode-cdn.net/home/cystodev1/code/cystoaid_data_pipline/~/.local/lib/python3.10/site-packages/fiftyone/utils/cvat.py:5782) anno["frame"] = frame
ValueError: max() arg is an empty sequence
Code/Video to reproduce issue
You need a video in CVAT that uses the track rectangle. The rectangle must be set to non-outside tracked on at least the second to last frame so it fills the remaining frames with rectangle copies of its the last instance.
OS Platform and Distribution (e.g., Linux Ubuntu 22.04): 22.04
Python version (python --version): Python 3.10.12
FiftyOne version (fiftyone --version): FiftyOne v0.23.7, Voxel51, Inc
FiftyOne installed from (pip or source): pip
Other info/logs
I found a fix.
I noticed if I ran the import_annotations method on a video with no rectangles on the ending frame of the video i could get passed the error and upon further inspection I could see that the difference between the two was a relative and absolute path assignment.
By setting the absolute path below the video data loads correctly regardless of if the video ends on an outside tracked frame or not.
Im not sure where the absolute path should actually be set but this fixed the issue for me.
def _parse_task_metadata(
api,
task_id,
data_map,
task_filepaths,
ignored_filenames,
download_tasks,
data_dir=None,
download_media=False,
):
resp = api.get(api.task_data_meta_url(task_id)).json()
start_frame = resp.get("start_frame", None)
stop_frame = resp.get("stop_frame", None)
chunk_size = resp.get("chunk_size", None)
#MY FIX START
data_dir = f'{os.getcwd()}/{data_dir}'
#MY FIX END
cvat_id_map = {}
for frame_id, frame in enumerate(resp["frames"]):
filename = frame["name"]
filepath = data_map.get(filename, None)
if download_media:
if filepath is None and data_dir:
filepath = os.path.join(data_dir, filename)
if filepath and not os.path.exists(filepath):
download_tasks.append(
(
api,
task_id,
frame_id,
filepath,
start_frame,
stop_frame,
chunk_size,
)
)
if filepath is not None:
cvat_id_map[filepath] = frame_id
task_filepaths.append(filepath)
else:
ignored_filenames.append(filename)
return cvat_id_map
Willingness to contribute
The FiftyOne Community encourages bug fix contributions. Would you or another
member of your organization be willing to contribute a fix for this bug to the
FiftyOne codebase?
Yes. I can contribute a fix for this bug independently
Yes. I would be willing to contribute a fix for this bug with guidance
from the FiftyOne community
No. I cannot contribute a bug fix at this time
The text was updated successfully, but these errors were encountered:
Rephil2
changed the title
[BUG] CVAT fouc.import_annotations not importing annotations
[BUG] CVAT fouc.import_annotations not importing video annotations
Apr 27, 2024
Describe the problem
Value Error raised when fetching a video with specific rectangle type (non-outside tracked object).
The video downloads just fine:
but this error kicks in immediately after:
Code/Video to reproduce issue
You need a video in CVAT that uses the track rectangle. The rectangle must be set to non-outside tracked on at least the second to last frame so it fills the remaining frames with rectangle copies of its the last instance.
System information
python --version
): Python 3.10.12fiftyone --version
): FiftyOne v0.23.7, Voxel51, IncOther info/logs
I found a fix.
I noticed if I ran the import_annotations method on a video with no rectangles on the ending frame of the video i could get passed the error and upon further inspection I could see that the difference between the two was a relative and absolute path assignment.
By setting the absolute path below the video data loads correctly regardless of if the video ends on an outside tracked frame or not.
Im not sure where the absolute path should actually be set but this fixed the issue for me.
/home/cystodev1/.local/lib/python3.10/site-packages/fiftyone/utils/cvat.py:
Willingness to contribute
The FiftyOne Community encourages bug fix contributions. Would you or another
member of your organization be willing to contribute a fix for this bug to the
FiftyOne codebase?
from the FiftyOne community
The text was updated successfully, but these errors were encountered: