Skip to content

Instantly share code, notes, and snippets.

@pinge
Last active August 23, 2018 18:42
Show Gist options
  • Save pinge/0fc85d1c20ebac7112a9aa5b0ebc4115 to your computer and use it in GitHub Desktop.
Save pinge/0fc85d1c20ebac7112a9aa5b0ebc4115 to your computer and use it in GitHub Desktop.

Yolo_mark on Ubuntu 16.04 LTS

clone repo

git clone https://github.com/AlexeyAB/Yolo_mark.git
cd Yolo_mark

add linux yolo mark command

cd x64/Release
cat > ./linux_mark <<EOF
#!/usr/bin/env bash

../../yolo_mark data/img data/train.txt data/obj.names
EOF
chmod +x ./linux_mark

running yolo mark

./yolo_mark

extract a frame every N seconds with FFmpeg

ffmpeg -i input.mp4 -vf fps=1/N frame_%03d.jpg

rename frame filenames by increasing the base number

find ./ -name "*.jpg" | awk -F'[_.]' '{ printf "mv %s .%s_%s.%s\n", $0, $2, $3 + 100, $4; }' | bash

create train.txt file

find ./ -name "*.jpg" | sed 's/\./dataset_folders\/images\/object_name/' > train.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment