curt-park commited on
Commit
9dac542
·
1 Parent(s): a74cdb0

Rephrase texts

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -17,10 +17,10 @@ from isegm.inference.predictors import BasePredictor, get_predictor
17
  # Global scope objects.
18
  ###################################
19
  URL_PREFIX = "https://huggingface.co/curt-park/interactive-segmentation/resolve/main"
20
- CANVAS_HEIGHT, CANVAS_WIDTH = 600, 600
21
  POS_COLOR, NEG_COLOR = "#3498DB", "#C70039"
 
22
  ERR_X, ERR_Y = 5.5, 1.0
23
- MODELS = {"RITM": "ritm_coco_lvis_h18_itermask.pth"}
24
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
25
  clicker = ck.Clicker()
26
  predictor = None
@@ -71,7 +71,7 @@ def predict(image: Image, mask: torch.Tensor, threshold: float = 0.5) -> torch.T
71
  # Sidebar GUI
72
  ###################################
73
  # Items in the sidebar.
74
- model = st.sidebar.selectbox("Select a Model:", tuple(MODELS.keys()))
75
  threshold = st.sidebar.slider("Threshold: ", 0.0, 1.0, 0.5)
76
  marking_type = st.sidebar.radio("Click Type:", ("Positive", "Negative"))
77
  image_path = st.sidebar.file_uploader("Background Image:", type=["png", "jpg", "jpeg"])
 
17
  # Global scope objects.
18
  ###################################
19
  URL_PREFIX = "https://huggingface.co/curt-park/interactive-segmentation/resolve/main"
20
+ MODELS = {"RITM": "ritm_coco_lvis_h18_itermask.pth"}
21
  POS_COLOR, NEG_COLOR = "#3498DB", "#C70039"
22
+ CANVAS_HEIGHT, CANVAS_WIDTH = 600, 600
23
  ERR_X, ERR_Y = 5.5, 1.0
 
24
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
25
  clicker = ck.Clicker()
26
  predictor = None
 
71
  # Sidebar GUI
72
  ###################################
73
  # Items in the sidebar.
74
+ model = st.sidebar.selectbox("Select a Method:", tuple(MODELS.keys()))
75
  threshold = st.sidebar.slider("Threshold: ", 0.0, 1.0, 0.5)
76
  marking_type = st.sidebar.radio("Click Type:", ("Positive", "Negative"))
77
  image_path = st.sidebar.file_uploader("Background Image:", type=["png", "jpg", "jpeg"])