video_features icon indicating copy to clipboard operation
video_features copied to clipboard

Extraction from paths with the same filename are not supported

Open v-iashin opened this issue 2 years ago • 4 comments

Currently, it is assumed that all user-specified files have distinct file names. However, it leads to unwanted behavior if a user extracts files from multiple folders, e.g.

dataset/
  dog/
    000.mp4
  cat/
    000.mp4

On a side note, it would be lovely to keep the folder structure, if any, during the save. Plus, model_name and feature_type should be a part of the path.

<output_path>/feature_type/(model_name/)<path_relative_to(os.common_path(list_of_paths))>.

v-iashin avatar Aug 18 '22 12:08 v-iashin

MWE:

python main.py flow_type="raft" \
    feature_type=i3d \
    device_ids="[0]" on_extraction="save_numpy" \
    video_paths="[./todel/cat/000.mp4, ./todel/dog/000.mp4]"
ls ./output

v-iashin avatar Aug 18 '22 12:08 v-iashin

python main.py flow_type="raft" \
    feature_type=i3d \
    device_ids="[0]" on_extraction="save_numpy" \
    video_paths="[./todel/cat/000.mp4, ./todel/dog/000.mp4]"

Now it fails (and that's ok 😆 ).

v-iashin avatar Aug 18 '22 14:08 v-iashin

I think video_paths's behavior is normal because we are dealing with independent videos but not a dataset or a directory in this case.

I agree that it would be lovely to keep the folder structure, but this feature may correspond to a new parameter (e.g., video_dir or video_dataset).

Kamino666 avatar Aug 19 '22 03:08 Kamino666

Yes, it is. The problem was with the saving of the extracted features as they collide with other user-specified files if they are from different folders but have the same file name.

I agree that we may need a new parameter if a user wants to specify a folder, like a dataset.

v-iashin avatar Aug 19 '22 04:08 v-iashin