| 279 | } |
| 280 | |
| 281 | static void run_pvs_box(app_state& app) { |
| 282 | if (!app.image_encoded) return; |
| 283 | if (!app.has_pvs_box) return; |
| 284 | snprintf(app.status, sizeof(app.status), "Running PVS (box)..."); |
| 285 | app.busy = true; |
| 286 | |
| 287 | sam3_pvs_params pvs; |
| 288 | pvs.pos_points = app.pos_points; |
| 289 | pvs.neg_points = app.neg_points; |
| 290 | pvs.box = app.pvs_box; |
| 291 | pvs.use_box = true; |
| 292 | pvs.multimask = app.multimask; |
| 293 | |
| 294 | app.result = sam3_segment_pvs(*app.state, *app.model, pvs); |
| 295 | snprintf(app.status, sizeof(app.status), "PVS (box): %d masks.", |
| 296 | (int)app.result.detections.size()); |
| 297 | app.busy = false; |
| 298 | build_overlay(app); |
| 299 | } |
| 300 | |
| 301 | static void export_masks(const app_state& app) { |
| 302 | for (size_t i = 0; i < app.result.detections.size(); ++i) { |
no test coverage detected