Last active
April 12, 2018 04:33
-
-
Save yampy/cd47946ad2c8cd00bc87091b3c8c18d7 to your computer and use it in GitHub Desktop.
SSD(Keras / TensorFlow)でディープラーニングによる動画の物体検出を行う ref: https://qiita.com/yampy/items/37c607fdf77a919cda5d
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
$ git clone https://github.com/rykov8/ssd_keras.git | |
$ cd ssd_keras |
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
conda env create -f ykov8_ssd_keras.yaml | |
source activate rykov8_ssd_keras |
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
cd testing_utils/ | |
python videotest_example.py |
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
(省略) | |
person 0.61 | |
person 0.83 | |
person 0.72 | |
dog 0.78 | |
person 0.61 | |
person 0.75 | |
dog 0.75 | |
dog 0.73 | |
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
convert -adjoin out/*.gif output.gif |
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
# 87行目(修正) | |
vidw = vid.get(cv2.CAP_PROP_FRAME_WIDTH) | |
vidh = vid.get(cv2.CAP_PROP_FRAME_HEIGHT) | |
# 99行目(追加) | |
num_frame = 0 | |
# 163行目(追加) | |
print(text) | |
# 183行目(追加) | |
print(text) | |
cv2.imwrite("frame_" + str('{0:04d}'.format(num_frame)) +".png", to_draw) | |
# 184行目(追加) | |
num_frame += 1 |
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
# 24行目を修正して、自身の動画ファイルを指定 | |
vid_test.run('./myvideo.mp4') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment