-
Notifications
You must be signed in to change notification settings - Fork 0
/
to_f.py
31 lines (21 loc) · 885 Bytes
/
to_f.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
import os
import glob
list = os.listdir("G:\Code_School/python/Test/htdocs/test/images") # dir is your directory path
number_files = len(list)
print(number_files)
total_files=number_files
current_files=0
while 1:
list = os.listdir("G:\Code_School/python/Test/htdocs/test/images") # dir is your directory path
number_files = len(list)
#print(number_files)
list_of_files = glob.glob('G:\Code_School/python/Test/htdocs/test/images\*') # * means all if need specific format then *.csv
latest_file = max(list_of_files, key=os.path.getctime)
#print(latest_file)
total_files=number_files
def DetectFruit():
os.popen('python C:\\tensorflow1\\models\\research\\object_detection\\own_detection_image.py '+latest_file,"r")
if total_files!=current_files:
DetectFruit()
print("ok")
current_files=total_files