File size: 855 Bytes
2b28fa4 16b9d42 2b28fa4 16b9d42 2b28fa4 16b9d42 2b28fa4 16b9d42 2b28fa4 f04ac41 16b9d42 f04ac41 16b9d42 f04ac41 16b9d42 f04ac41 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
#!/bin/bash
### Options
PLAYLIST_URL=https://youtube.com/playlist?list=PLwlIgd6_8FLJqgvIgtUye8Jz2jSKLrCAI
### ----- Start script -----
### get playlist name
PLAYLIST_NAME=$(yt-dlp --no-warnings --dump-single-json --playlist-end 1 $PLAYLIST_URL | jq -r '.title')
echo "Playlist Name:" $PLAYLIST_NAME
### get script dir
SCRIPT_DIR=$(cd $(dirname $0); pwd)
### Training dataset
INPUT_DIR=$SCRIPT_DIR/../generated/$PLAYLIST_NAME
TRAIN_DIR=$SCRIPT_DIR/../maskal_ws/datasets/train
VALIDATION_DIR=$SCRIPT_DIR/../maskal_ws/datasets/val
TEST_DIR=$SCRIPT_DIR/../maskal_ws/datasets/test
### Training dataset
mkdir -p $TRAIN_DIR
cp $INPUT_DIR/*.png $TRAIN_DIR
### Validation dataset
mkdir -p $VALIDATION_DIR
shuf -zn5 -e $TRAIN_DIR/*.png | xargs -0 mv -vt $VALIDATION_DIR
### Test dataset
mkdir -p $TEST_DIR
shuf -zn5 -e $TRAIN_DIR/*.png | xargs -0 mv -vt $TEST_DIR
|