Vishaltiwari2019 commited on
Commit
4a6a6a7
·
verified ·
1 Parent(s): ffc2154

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -1,6 +1,6 @@
1
  from transformers import DetrImageProcessor, DetrForObjectDetection
2
  import torch
3
- from PIL import Image, ImageDraw
4
  import gradio as gr
5
  import requests
6
  import random
@@ -31,7 +31,6 @@ def detect_objects(image):
31
  return image
32
 
33
 
34
-
35
  def upload_image(file):
36
  image = Image.open(file.name)
37
  image_with_boxes = detect_objects(image)
@@ -46,4 +45,4 @@ iface = gr.Interface(
46
  allow_flagging=False
47
  )
48
 
49
- iface.launch()
 
1
  from transformers import DetrImageProcessor, DetrForObjectDetection
2
  import torch
3
+ from PIL import Image, ImageDraw, ImageFont # Import ImageFont
4
  import gradio as gr
5
  import requests
6
  import random
 
31
  return image
32
 
33
 
 
34
  def upload_image(file):
35
  image = Image.open(file.name)
36
  image_with_boxes = detect_objects(image)
 
45
  allow_flagging=False
46
  )
47
 
48
+ iface.launch()