Open brimoor opened 2 years ago
Hi @brimoor, thanks for creating this feature request. I tried your workaround but I got an error:
Traceback (most recent call last):
File "/Users/X/.../test_fo.py", line 34, in <module>
fouv.transform_video(frames_patt, video_path)
File "/Users/X/../venv/lib/python3.8/site-packages/fiftyone/utils/video.py", line 404, in transform_video
_transform_video(
File "/Users/X/../venv/lib/python3.8/site-packages/fiftyone/utils/video.py", line 769, in _transform_video
ffmpeg.run(inpath, outpath, verbose=verbose)
File "/Users/X/../venv/lib/python3.8/site-packages/eta/core/video.py", line 4183, in run
+ ["-i", inpath]
TypeError: can only concatenate list (not "NoneType") to list
I did some digging and found out that in line 4144
of eta/core/video.py
the if statement is True
then in_opts
is set wrongly to None
in line 4150
since .extend(..)
returns None
. I think this is a bug?
My setup is Python 3.8.9, FiftyOne v0.16.5 on a MacBook Pro (M1) with macOS Monterey.
Ah good catch, thanks! That's a bug that was fixed in https://github.com/voxel51/eta/pull/565 and will be resolved in fiftyone>0.16.5
.
For now I updated the example code to avoid the issue.
Is there any update on this feature? Would love to use that in my projects, as many labelling tools require frame-by-frame video annotation. Thank you for all the good work :)
Background
Currently FiftyOne requires video samples to provide a
filepath
to an encoded video file on disk (eg MP4), which is used by the App and other API methods when access to the video data is required.However, the "native" format of some user's video data is not MP4s but rather directories of image sequences:
When per-frame paths are available, the best practice is to provide these as
Frame.filepath
values on your FiftyOne dataset like so:which allows for using FiftyOne's frame views feature to work with the dataset as a set of frame images:
However,
Sample.filepath
must also be provided.Feature request
Should we make
Sample.filepath
optional for video datasets, if complete per-frame filepath information is provided viaFrame.filepath
?Pros
Cons
apply_model()
,compute_embeddings()
, exporters, etc.Workaround
If you only have per-frame image sequences, you can use the builtin transform_video() utility to generate an encoded video from your frames.
The example below demonstrates the idea: