oldgarden21 commited on
Commit
eeae096
ยท
verified ยท
1 Parent(s): 3de8d4c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -13,7 +13,6 @@ def object_detection(image):
13
  outputs = model(**inputs)
14
 
15
  # ๊ฒฐ๊ณผ ์ฒ˜๋ฆฌ ๋กœ์ง์„ ๊ตฌํ˜„ํ•˜์„ธ์š”.
16
- # ์˜ˆ์ œ ์ฝ”๋“œ๋Š” ๊ฒฐ๊ณผ ์ฒ˜๋ฆฌ ๋ถ€๋ถ„์„ ๋‹จ์ˆœํ™”ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.
17
  # ์‹ค์ œ๋กœ๋Š” ํƒ์ง€๋œ ๊ฐ์ฒด๋ฅผ ์ด๋ฏธ์ง€ ์œ„์— ๋ฐ•์Šค๋กœ ๊ทธ๋ฆฌ๋Š” ๋“ฑ์˜ ์ฒ˜๋ฆฌ๊ฐ€ ํ•„์š”ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
18
  # ์—ฌ๊ธฐ์„œ๋Š” outputs์˜ ์š”์•ฝ๋œ ์ •๋ณด๋งŒ์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.
19
  return outputs.logits.tolist()
@@ -21,8 +20,8 @@ def object_detection(image):
21
  # Gradio ์ธํ„ฐํŽ˜์ด์Šค ์„ค์ • ๋ฐ ์•ฑ ์‹คํ–‰
22
  iface = gr.Interface(
23
  fn=object_detection,
24
- inputs=gr.Image(type="pil", tool="editor"),
25
- outputs=gr.Text(),
26
  title="Object Detection with DETR",
27
  description="Upload an image, and the model will detect objects in the image."
28
  )
 
13
  outputs = model(**inputs)
14
 
15
  # ๊ฒฐ๊ณผ ์ฒ˜๋ฆฌ ๋กœ์ง์„ ๊ตฌํ˜„ํ•˜์„ธ์š”.
 
16
  # ์‹ค์ œ๋กœ๋Š” ํƒ์ง€๋œ ๊ฐ์ฒด๋ฅผ ์ด๋ฏธ์ง€ ์œ„์— ๋ฐ•์Šค๋กœ ๊ทธ๋ฆฌ๋Š” ๋“ฑ์˜ ์ฒ˜๋ฆฌ๊ฐ€ ํ•„์š”ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
17
  # ์—ฌ๊ธฐ์„œ๋Š” outputs์˜ ์š”์•ฝ๋œ ์ •๋ณด๋งŒ์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.
18
  return outputs.logits.tolist()
 
20
  # Gradio ์ธํ„ฐํŽ˜์ด์Šค ์„ค์ • ๋ฐ ์•ฑ ์‹คํ–‰
21
  iface = gr.Interface(
22
  fn=object_detection,
23
+ inputs=gr.Image(shape=(512, 512)),
24
+ outputs="json",
25
  title="Object Detection with DETR",
26
  description="Upload an image, and the model will detect objects in the image."
27
  )