neko941 commited on
Commit
94239c6
1 Parent(s): 10878a4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py CHANGED
@@ -11,6 +11,16 @@ image = st.text_input('Image URL', '')
11
 
12
  #image uploader
13
  # image = st.file_uploader(label = "Upload your image here",type=['png','jpg','jpeg'])
 
 
 
 
 
 
 
 
 
 
14
 
15
  def check_file(file, suffix=''):
16
  # Search/download file (if necessary) and return path
 
11
 
12
  #image uploader
13
  # image = st.file_uploader(label = "Upload your image here",type=['png','jpg','jpeg'])
14
+ def check_suffix(file='yolov5s.pt', suffix=('.pt',), msg=''):
15
+ # Check file(s) for acceptable suffix
16
+ if file and suffix:
17
+ if isinstance(suffix, str):
18
+ suffix = [suffix]
19
+ for f in file if isinstance(file, (list, tuple)) else [file]:
20
+ s = Path(f).suffix.lower() # file suffix
21
+ if len(s):
22
+ assert s in suffix, f"{msg}{f} acceptable suffix is {suffix}"
23
+
24
 
25
  def check_file(file, suffix=''):
26
  # Search/download file (if necessary) and return path