Skip to content

Commit

Permalink
Save the resulting frames on training and evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
mertyildiran committed Jul 5, 2020
1 parent 9a29edf commit cdcbbfb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions examples/audio_visual.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import time
from pathlib import Path
import cv2
import numpy as np
from pydub import AudioSegment
Expand All @@ -7,6 +8,10 @@

VIDEO_FILE = 'videos/lower3.mp4'

Path("videos/output/original").mkdir(parents=True, exist_ok=True)
Path("videos/output/training").mkdir(parents=True, exist_ok=True)
Path("videos/output/evaluation").mkdir(parents=True, exist_ok=True)

audio = AudioSegment.from_file(VIDEO_FILE, "mp4")
audio_samples = audio.get_array_of_samples()

Expand Down Expand Up @@ -77,6 +82,9 @@
cv2.namedWindow('learn')
cv2.imshow('learn', learn)

cv2.imwrite("videos/output/original/{0}.png".format(str(fc)), buf)
cv2.imwrite("videos/output/training/{0}.png".format(str(fc)), learn)

cv2.waitKey(int(1000 * TRAINING_DURATION))
fc += 1
net.load(chunk)
Expand All @@ -102,6 +110,9 @@

cv2.namedWindow('output')
cv2.imshow('output', buf)

cv2.imwrite("videos/output/evaluation/{0}.png".format(str(fc)), buf)

cv2.waitKey(int(1000 * TRAINING_DURATION))
fc += 1

Expand Down

0 comments on commit cdcbbfb

Please sign in to comment.