Skip to content

Commit

Permalink
samples_frames_1_from_5
Browse files Browse the repository at this point in the history
  • Loading branch information
oshadaamila committed Mar 11, 2019
1 parent f6bb857 commit 8acaf5a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
5 changes: 3 additions & 2 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
import os
import glob
import summary_from_frame_list
import datetime
from shutil import copyfile

def run():

t1 = datetime.datetime.now()
print("**************** Give the details of the video which need to summarise ****************\n")

original_video_location = input("Enter the video path (Ex: ./data/input_video/input_video.mp4) :\n")
Expand Down Expand Up @@ -60,6 +61,6 @@ def run():
copyfile(source, destination)

print("\n**************** Keyframes moved to the ./test_data/generated_summary_keyframes/ location ****************")

elapsed_time = datetime.datetime.now() -
if __name__ == "__main__":
run()
8 changes: 6 additions & 2 deletions src/test_objects_identifier_of_frames.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,19 @@
'''

import objects_identifier_of_frames
import datetime;

def run():
# image folder
input_frames_path = "./data/generated_frames/"
input_frames_path = "./test_data/generated_frames/"

# dimensions of images
img_width, img_height = 224, 224
t1 = datetime.datetime.now()
frames_predictions_dictionary = objects_identifier_of_frames.generate_object_list_of_frames(input_frames_path, img_width, img_height )

t2 = datetime.datetime.now()
elapsedtime = t2-t1
print("elapsed time is"+str(elapsedtime))
for the_key, the_value in frames_predictions_dictionary.items():
print(the_key, ' ---> ', the_value)

Expand Down
19 changes: 10 additions & 9 deletions src/video_to_frames.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,21 @@ def get_frames(video_input_path, frame_output_path):
return_status, frame = video_capture.read()

current_frame = 0

counter = 0
while(return_status):

# Saving the current frame's image as a jpg file
frame_location = frame_output_path+"frame" + str(current_frame) + ".jpg"
print ("Creating..." + frame_location)
cv2.imwrite(frame_location, frame)
if(counter==4):
# Saving the current frame's image as a jpg file
frame_location = frame_output_path+"frame" + str(current_frame) + ".jpg"
print ("Creating..." + frame_location)
cv2.imwrite(frame_location, frame)
# Increasing the current frame value for the next frame
current_frame += 1
counter = 0

# Capture frame-by-frame
return_status, frame = video_capture.read()

# Increasing the current frame value for the next frame
current_frame += 1

counter +=1
# Release the capture
video_capture.release()
cv2.destroyAllWindows()
Expand Down

0 comments on commit 8acaf5a

Please sign in to comment.