[FR] export_frames_media
option when exporting datasets
#4717
Labels
feature
Work on a feature request
export_frames_media
option when exporting datasets
#4717
Proposal Summary
When exporting any dataset with
dataset.export(...)
, theexport_media=True
option copies the source imagery (or videos) into theexport_dir
directory. This is especially useful when therel_dir
option is the sameexport_dir
, since that directory can be moved anywhere and reloaded instantly. However, this option only applies to media insample.filepath
, currently.Frames media in
frames.filepath
is not exportable in that way, OR importable in that way. It makes sense that not exporting the frames media would be the default; it's much tidier to only depend on the video samples and sample the frames at will. But, there are plenty of use cases where it would be helpful to export and reimport the frames media directly. For example:dataset.to_frames(sample_frames=True)
to sample the frames, but I used some other fancy ffmpeg command. I don’t want to have to rerun it.So, I'm proposing an option like
export_frames_media
......which gives the user the option to export to frames media into the
export_dir
along with the samples.Bonus Issue:
rel_dir
does not extend toframes.filepath
One related change would be for
rel_dir
to operate onframe.filepath
in the same way it applies tosample.filepath
. Lets say I export a video dataset withrel_dir
, move the dataset+media to a new directory, then import my dataset withrel_dir
. Currently, mysample.filepaths
will point to the new directory but myframe.filepaths
will still point to the old directory! Even if I moved the sampled frames into the export_dir, the frames would still have to be resampled. This is a clear inconsistency, but I'll link this slack thread for details.These seems like straightforward and helpful changes! Wish I had more time right now to implement them...
P.S.: passing ffmpeg options to
dataset.to_frames
could be easier. I followeddataset.to_frames
down the rabbit hole toeta.video.FFmpeg
and tried to expose thein_opts
andout_opts
back up the chain toto_frames
, but the sparse sampling techniques threw me.Motivation
Captured above.
What areas of FiftyOne does this feature affect?
fiftyone
Python libraryDetails
Captured above.
Willingness to contribute
The text was updated successfully, but these errors were encountered: