23A066X commited on
Commit
ea79ead
1 Parent(s): 55af1b9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -9
app.py CHANGED
@@ -1,14 +1,16 @@
1
- import gradio as gr
2
  import matplotlib.pyplot as plt
3
  import numpy as np
 
4
  from PIL import Image
5
  import tensorflow as tf
6
  from object_detection.utils import label_map_util
7
  from object_detection.utils import visualization_utils as viz_utils
8
  from object_detection.utils import ops as utils_op
 
 
9
  import gradio as gr
10
- import os
11
- import cv2
12
 
13
  def greet(name):
14
  return "Hello " + name + "!!"
@@ -52,12 +54,6 @@ detection_model = load_model()
52
  # predicted_img = predict(image_arr)
53
  # predicted_img.save('predicted.jpg')
54
 
55
- gr.Interface(fn=predict,
56
- inputs=gr.Image(type="pil"),
57
- outputs=gr.Image(type="pil")
58
- ).launch(share=True)
59
-
60
-
61
 
62
  gr.Interface(fn=predict,
63
  inputs=[gr.Image(type="pil",label="Input Image"),gr.Textbox(placeholder="0.50",label="Set the confidence threshold (0.00-1.00)")],
 
 
1
  import matplotlib.pyplot as plt
2
  import numpy as np
3
+ from six import BytesIO
4
  from PIL import Image
5
  import tensorflow as tf
6
  from object_detection.utils import label_map_util
7
  from object_detection.utils import visualization_utils as viz_utils
8
  from object_detection.utils import ops as utils_op
9
+ import tarfile
10
+ import wget
11
  import gradio as gr
12
+ from huggingface_hub import snapshot_download
13
+ import os
14
 
15
  def greet(name):
16
  return "Hello " + name + "!!"
 
54
  # predicted_img = predict(image_arr)
55
  # predicted_img.save('predicted.jpg')
56
 
 
 
 
 
 
 
57
 
58
  gr.Interface(fn=predict,
59
  inputs=[gr.Image(type="pil",label="Input Image"),gr.Textbox(placeholder="0.50",label="Set the confidence threshold (0.00-1.00)")],