Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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(
|
| 25 |
-
outputs=
|
| 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 |
)
|