-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest_objects_identifier_of_frames.py
35 lines (28 loc) · 1.22 KB
/
test_objects_identifier_of_frames.py
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
26
27
28
29
30
31
32
33
34
35
'''
Within this script, focus to test the script in objects_identifier_of_frames.py.
Requirements
----
You require OpenCV 3.2 to be installed.
Run
----
If need to run this script seperately, then can edit the relevant input file path.
Or can make the folder in the this scripts' folder as ./data/generated_frames according to the script.
It needs to include set of frames as .jpg files within the ./data/generated_frames folder. For that an use the video_to_frames.py script or test_video_to_frames.py script
As done in the this testing script, can use the objects_identifier_of_frames.py script in other programs.
'''
import objects_identifier_of_frames
import datetime;
def run():
# image folder
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)
if __name__ == "__main__":
run()