xinghaochen commited on
Commit
0a9c5d5
1 Parent(s): 5521308
Files changed (1) hide show
  1. app.py +12 -13
app.py CHANGED
@@ -141,12 +141,12 @@ def segment_with_points(
141
  )
142
  image = session_state['image_with_prompt']
143
 
144
- coord_np = np.array(session_state['coord_list'])
145
- label_np = np.array(session_state['label_list'])
146
- masks, scores, logits = predictor.predict(
147
- point_coords=coord_np,
148
- point_labels=label_np,
149
- )
150
  print(f'scores: {scores}')
151
  area = masks.sum(axis=(1, 2))
152
  print(f'area: {area}')
@@ -208,13 +208,12 @@ def segment_with_box(
208
  )
209
 
210
  box_np = np.array(xy)
211
- masks, scores, _ = predictor.predict(
212
- point_coords=None,
213
- point_labels=None,
214
- box=box_np[None, :],
215
- )
216
- annotations = np.expand_dims(masks[scores.argmax()], axis=0)
217
-
218
 
219
  seg = fast_process(
220
  annotations=annotations,
 
141
  )
142
  image = session_state['image_with_prompt']
143
 
144
+ coord_np = np.array(session_state['coord_list'])
145
+ label_np = np.array(session_state['label_list'])
146
+ masks, scores, logits = predictor.predict(
147
+ point_coords=coord_np,
148
+ point_labels=label_np,
149
+ )
150
  print(f'scores: {scores}')
151
  area = masks.sum(axis=(1, 2))
152
  print(f'area: {area}')
 
208
  )
209
 
210
  box_np = np.array(xy)
211
+ masks, scores, _ = predictor.predict(
212
+ point_coords=None,
213
+ point_labels=None,
214
+ box=box_np[None, :],
215
+ )
216
+ annotations = np.expand_dims(masks[scores.argmax()], axis=0)
 
217
 
218
  seg = fast_process(
219
  annotations=annotations,