Spaces:
Runtime error
Runtime error
ayaanzaveri
commited on
Commit
•
1e8df9a
1
Parent(s):
660b68d
Update app.py
Browse files
app.py
CHANGED
@@ -19,12 +19,18 @@ pipe = pipeline('object-detection', model=model, feature_extractor=extractor)
|
|
19 |
|
20 |
img_url = st.text_input('Image URL', 'https://images.unsplash.com/photo-1556911220-bff31c812dba?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=2468&q=80')
|
21 |
|
|
|
|
|
22 |
img_data = requests.get(img_url).content
|
23 |
with open('detect.jpg', 'wb') as handler:
|
24 |
handler.write(img_data)
|
25 |
|
|
|
|
|
26 |
output = pipe(img_url)
|
27 |
|
|
|
|
|
28 |
fpath = "Poppins-SemiBold.ttf"
|
29 |
prop = font_manager.FontProperties(fname=fpath)
|
30 |
|
@@ -55,4 +61,6 @@ image = Image.open('detect-bbox.jpg')
|
|
55 |
|
56 |
st.image(image, caption='DETR Image')
|
57 |
|
58 |
-
plt.show()
|
|
|
|
|
|
19 |
|
20 |
img_url = st.text_input('Image URL', 'https://images.unsplash.com/photo-1556911220-bff31c812dba?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=2468&q=80')
|
21 |
|
22 |
+
st.caption('Downloading Image...')
|
23 |
+
|
24 |
img_data = requests.get(img_url).content
|
25 |
with open('detect.jpg', 'wb') as handler:
|
26 |
handler.write(img_data)
|
27 |
|
28 |
+
st.caption('Running Detection...')
|
29 |
+
|
30 |
output = pipe(img_url)
|
31 |
|
32 |
+
st.caption('Adding Predictions to Image...')
|
33 |
+
|
34 |
fpath = "Poppins-SemiBold.ttf"
|
35 |
prop = font_manager.FontProperties(fname=fpath)
|
36 |
|
|
|
61 |
|
62 |
st.image(image, caption='DETR Image')
|
63 |
|
64 |
+
plt.show()
|
65 |
+
|
66 |
+
st.caption('Done!')
|