JunchuanYu commited on
Commit
39d0cbe
·
1 Parent(s): d7c2a2b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -7
app.py CHANGED
@@ -14,19 +14,24 @@ from PIL import Image
14
 
15
  from segment_anything import SamAutomaticMaskGenerator, SamPredictor, sam_model_registry
16
 
17
- # st.markdown(
18
- # """
19
- # The Segment Anything Model (SAM) produces high quality object masks from input prompts such as points or boxes, and it can be used to generate masks for all objects in an image.
20
- # It has been trained on a dataset of 11 million images and 1.1 billion masks, and has strong zero-shot performance on a variety of segmentation tasks.
21
- # """
22
- # )
 
 
 
 
 
23
 
24
  # suppress server-side GUI windows
25
  matplotlib.pyplot.switch_backend('Agg')
26
 
27
  # setup models
28
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
29
- sam = sam_model_registry["vit_b"](checkpoint="./sam_vit_b_01ec64.pth")
30
  sam.to(device=device)
31
  mask_generator = SamAutomaticMaskGenerator(sam)
32
  predictor = SamPredictor(sam)
 
14
 
15
  from segment_anything import SamAutomaticMaskGenerator, SamPredictor, sam_model_registry
16
 
17
+ st.markdown(
18
+ """
19
+ # Segment Anything Model (SAM)
20
+ ### A test on remote sensing data
21
+
22
+ - Paper:[Link](https://scontent-fml2-1.xx.fbcdn.net/v/t39.2365-6/10000000_900554171201033_1602411987825904100_n.pdf?_nc_cat=100&ccb=1-7&_nc_sid=3c67a6&_nc_ohc=Ald4OYhL6hgAX-ZcGmS&_nc_ht=scontent-fml2-1.xx&oh=00_AfDk4FvyiDYeXgflANA2CbdV6HSS8CcJmrvjSfTqsgUmog&oe=643500E7)
23
+ - Github:[https://github.com/facebookresearch/segment-anything](https://github.com/facebookresearch/segment-anything)
24
+ - Dataset:https://ai.facebook.com/datasets/segment-anything-downloads/(https://ai.facebook.com/datasets/segment-anything-downloads/)
25
+ - Official Demo:[https://segment-anything.com/demo](https://segment-anything.com/demo)
26
+ """
27
+ )
28
 
29
  # suppress server-side GUI windows
30
  matplotlib.pyplot.switch_backend('Agg')
31
 
32
  # setup models
33
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
34
+ sam = sam_model_registry["vit_b"](checkpoint="./meta-model.pth")
35
  sam.to(device=device)
36
  mask_generator = SamAutomaticMaskGenerator(sam)
37
  predictor = SamPredictor(sam)