Noursine commited on
Commit
93f67bb
·
verified ·
1 Parent(s): 7294c48

Delete vertices

Browse files

Comment :
# --- Vertices extraction ---
# vertices = extract_polygon_vertices(raw_mask, epsilon)
# vertex_count = len(vertices) if vertices is not None else 0

Delete from JSON response the fields :
"vertices": vertices.tolist() if vertices is not None else None,
"vertex_count": vertex_count,

Files changed (1) hide show
  1. main2.py +2 -4
main2.py CHANGED
@@ -206,16 +206,14 @@ async def predict(
206
  polygon = mask_to_polygon(result_mask) if rooftop_type.lower() == "rectangular" else result_mask
207
 
208
  # --- Vertices extraction ---
209
- vertices = extract_polygon_vertices(raw_mask, epsilon)
210
- vertex_count = len(vertices) if vertices is not None else 0
211
 
212
  overlay = overlay_polygon(im, polygon)
213
  img_b64 = im_to_b64_png(overlay)
214
 
215
  return {
216
  "polygon": polygon.tolist() if polygon is not None else None,
217
- "vertices": vertices.tolist() if vertices is not None else None,
218
- "vertex_count": vertex_count,
219
  "image": img_b64,
220
  "model_used": model_used,
221
  "rooftop_type": rooftop_type,
 
206
  polygon = mask_to_polygon(result_mask) if rooftop_type.lower() == "rectangular" else result_mask
207
 
208
  # --- Vertices extraction ---
209
+ # vertices = extract_polygon_vertices(raw_mask, epsilon)
210
+ # vertex_count = len(vertices) if vertices is not None else 0
211
 
212
  overlay = overlay_polygon(im, polygon)
213
  img_b64 = im_to_b64_png(overlay)
214
 
215
  return {
216
  "polygon": polygon.tolist() if polygon is not None else None,
 
 
217
  "image": img_b64,
218
  "model_used": model_used,
219
  "rooftop_type": rooftop_type,