remotewith commited on
Commit
9f57e78
·
1 Parent(s): 0e6a922

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -0
app.py CHANGED
@@ -14,6 +14,32 @@ from model import create_effnetb2_model
14
  from timeit import default_timer as timer
15
  from typing import Tuple, Dict
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  # Setup class names
18
  class_names = ["dented","good"]
19
 
 
14
  from timeit import default_timer as timer
15
  from typing import Tuple, Dict
16
 
17
+ file_urls = [
18
+ 'https://www.dropbox.com/s/7sjfwncffg8xej2/video_7.mp4?dl=1'
19
+ ]
20
+
21
+ def download_file(url, save_name):
22
+ url = url
23
+ if not os.path.exists(save_name):
24
+ file = requests.get(url)
25
+ open(save_name, 'wb').write(file.content)
26
+
27
+ for i, url in enumerate(file_urls):
28
+ if 'mp4' in file_urls[i]:
29
+ download_file(
30
+ file_urls[i],
31
+ f"video.mp4"
32
+ )
33
+ else:
34
+ download_file(
35
+ file_urls[i],
36
+ f"image_{i}.jpg"
37
+ )
38
+
39
+
40
+ video_path = [['video.mp4']]
41
+
42
+
43
  # Setup class names
44
  class_names = ["dented","good"]
45