-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
16 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,30 @@ | ||
#!/bin/bash | ||
DEVICE=$1 | ||
# the same as =$2 but removes trailing slash in the path | ||
DATA_ROOT=${2%/} | ||
|
||
# you may want to switch it to `anaconda3` if you install anaconda instead of miniconda | ||
source ~/miniconda3/etc/profile.d/conda.sh | ||
|
||
# path to corsmal dataset without trailing slash (`/`) e.g. folder should have 1/ 2/ 3/ ... 12/ folders | ||
DATA_ROOT="/home/nvme/vladimir/corsmal" # ---- NO TRAILING '/' i.e. not '.....mal/' | ||
|
||
# making sure we are not in 'base' or any other | ||
conda deactivate | ||
conda deactivate | ||
|
||
# make sure to install it first (follow the guidelines in `./video_features` folder in README.md) | ||
conda activate r21d | ||
|
||
# form paths for feature extraction (will be saved to ./filepaths) | ||
python ./form_filenames.py --data_root $DATA_ROOT | ||
# change dir to `./video_features` folder | ||
# also patching the video_features code by creating tmp dir otherwise will fail with system error | ||
cd ./video_features && mkdir ./tmp | ||
|
||
# moving to `./video_features` folder | ||
cd ./video_features | ||
|
||
for container_id in {1..12} | ||
for container_dir in *$DATA_ROOT/ | ||
do | ||
/home/vladimir/miniconda3/envs/r21d/bin/python main.py \ | ||
# take only the last folder in the path which is the container id | ||
container_id="$(basename $container_dir)" | ||
|
||
# run feature extraction | ||
python main.py \ | ||
--feature_type r21d_rgb \ | ||
--device_ids 0 1 \ | ||
--device_ids $DEVICE \ | ||
--on_extraction save_numpy \ | ||
--file_with_video_paths "../filepaths/"$container_id"_rgb_file_paths.txt" \ | ||
--video_paths $(find $DATA_ROOT/$container_id/rgb/ -name "*.mp4")\ | ||
--output_path "../r21d_rgb_features/"$container_id"/r21d_rgb" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters