brandonongsc commited on
Commit
3417cc4
1 Parent(s): fd9e3a3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -8
app.py CHANGED
@@ -12,7 +12,7 @@ import gradio as gr
12
  from huggingface_hub import snapshot_download
13
  import os
14
 
15
- PATH_TO_LABELS = 'data/label_map.pbtxt'
16
  category_index = label_map_util.create_category_index_from_labelmap(PATH_TO_LABELS, use_display_name=True)
17
 
18
  def pil_image_as_numpy_array(pilimg):
@@ -36,13 +36,7 @@ def load_model():
36
 
37
  def load_model2():
38
  wget.download("https://drive.google.com/uc?export=download&id=1MasePsUVgjfWofmUhmMCvruOHuZMg7KG")
39
- #tarfile.open("balloon_model.tar.gz").extractall()
40
-
41
- import zipfile
42
- with zipfile.ZipFile("masknomask_detect_model.zip", 'r') as zip_ref:
43
- zip_ref.extractall("saved_model")
44
-
45
-
46
  model_dir = 'saved_model'
47
  detection_model = tf.saved_model.load(str(model_dir))
48
  return detection_model
 
12
  from huggingface_hub import snapshot_download
13
  import os
14
 
15
+ PATH_TO_LABELS = 'label_map.pbtxt'
16
  category_index = label_map_util.create_category_index_from_labelmap(PATH_TO_LABELS, use_display_name=True)
17
 
18
  def pil_image_as_numpy_array(pilimg):
 
36
 
37
  def load_model2():
38
  wget.download("https://drive.google.com/uc?export=download&id=1MasePsUVgjfWofmUhmMCvruOHuZMg7KG")
39
+ tarfile.open("balloon_model.tar.gz").extractall()
 
 
 
 
 
 
40
  model_dir = 'saved_model'
41
  detection_model = tf.saved_model.load(str(model_dir))
42
  return detection_model