Spaces:
Runtime error
Runtime error
bills
commited on
Commit
•
50bc9ac
1
Parent(s):
6fd3f58
Added some changes
Browse files
app.py
CHANGED
@@ -59,21 +59,16 @@ eval_col4.metric("mAP 0.5:0.95", "62.63%")
|
|
59 |
uploaded_file = st.file_uploader("Choose a ship imagery")
|
60 |
if uploaded_file is not None:
|
61 |
st.image(uploaded_file, caption='Image to predict')
|
62 |
-
folder_path = st.text_input("Image path"
|
|
|
|
|
63 |
|
64 |
prediction = st.button("Predict")
|
65 |
if prediction:
|
66 |
ship_model = torch.hub.load('ultralytics/yolov5', 'custom', path="best.pt", force_reload=True)
|
67 |
-
# results = ship_model(f"C:/Users/bilva/YOLOv5/ship_test/{uploaded_file.name}")
|
68 |
results = ship_model(f"{folder_path}")
|
69 |
with st.spinner("Loading..."):
|
70 |
time.sleep(3.5)
|
71 |
st.success("Done!")
|
72 |
st.image(np.squeeze(results.render()))
|
73 |
results.print()
|
74 |
-
# with st.echo():
|
75 |
-
# st.text(f"results.print()")
|
76 |
-
# st.markdown(results.print())
|
77 |
-
# for percent_progress in range (100):
|
78 |
-
# time.sleep(0.1)
|
79 |
-
# progress.progress(percent_progress + 1)
|
|
|
59 |
uploaded_file = st.file_uploader("Choose a ship imagery")
|
60 |
if uploaded_file is not None:
|
61 |
st.image(uploaded_file, caption='Image to predict')
|
62 |
+
folder_path = st.text_input("Image path",
|
63 |
+
help="This field the image path field that the model will predict the object inside the image that we have uploaded",
|
64 |
+
placeholder="Copy the path of image to this field")
|
65 |
|
66 |
prediction = st.button("Predict")
|
67 |
if prediction:
|
68 |
ship_model = torch.hub.load('ultralytics/yolov5', 'custom', path="best.pt", force_reload=True)
|
|
|
69 |
results = ship_model(f"{folder_path}")
|
70 |
with st.spinner("Loading..."):
|
71 |
time.sleep(3.5)
|
72 |
st.success("Done!")
|
73 |
st.image(np.squeeze(results.render()))
|
74 |
results.print()
|
|
|
|
|
|
|
|
|
|
|
|