bills commited on
Commit
cdca63f
1 Parent(s): 0ddec60

Add download sample image feature

Browse files
Files changed (1) hide show
  1. apps/home.py +10 -3
apps/home.py CHANGED
@@ -53,13 +53,20 @@ def app():
53
  - **label of the box**, indicate the name of the object that the model detect;
54
  - **number beside the label**, indicate how much the confidence of the model detect the object;
55
 
56
- ## Tutorial How to Use Ship Detection Model
57
  Here is the step by step how to use the model on this dashboard:
58
- - first, **prepare the satellite imagery image** that you want to use;
59
  - then, **choose the model** that you want to use **(on the side bar)**, **YOLOv5x6 Model** to use the YOLOv5x6 model or **Fine-Tuning Model** to use the fine-tuning model (study case: Tanjung Priok Port);
60
  - to upload your image, **click the "Browse File"** button, then upload your image;
61
  - after the image is uploaded, **right click the image** and then **copy the image address** by clicking **"Copy image address"** button;
62
  - then **paste the image address** on the box below the image;
63
  - finally, **click the "Predict"** button to start the detection of the object inside your image. Wait untill the result appear.
64
  """, unsafe_allow_html=True
65
- )
 
 
 
 
 
 
 
 
53
  - **label of the box**, indicate the name of the object that the model detect;
54
  - **number beside the label**, indicate how much the confidence of the model detect the object;
55
 
56
+ ## Tutorial How to Use Ship Detection Model
57
  Here is the step by step how to use the model on this dashboard:
58
+ - first, **prepare the satellite imagery image** that you want to use. If you don't have the image, you can use this sample image, by clicking the **"Download Image"** on the end of this dashboard usage explanation;
59
  - then, **choose the model** that you want to use **(on the side bar)**, **YOLOv5x6 Model** to use the YOLOv5x6 model or **Fine-Tuning Model** to use the fine-tuning model (study case: Tanjung Priok Port);
60
  - to upload your image, **click the "Browse File"** button, then upload your image;
61
  - after the image is uploaded, **right click the image** and then **copy the image address** by clicking **"Copy image address"** button;
62
  - then **paste the image address** on the box below the image;
63
  - finally, **click the "Predict"** button to start the detection of the object inside your image. Wait untill the result appear.
64
  """, unsafe_allow_html=True
65
+ )
66
+ with open("apps/image/sample.jpg", "rb") as file:
67
+ st.download_button(
68
+ label="Download Sample Image",
69
+ data=file,
70
+ file_name="sample.jpg",
71
+ mime="image/jpg"
72
+ )