Spaces:
Runtime error
Runtime error
Khunndev
Cursor
Improve detection accuracy with tiling defaults, 1024 model, and tuned thresholds.
2b21a73 Download frontend/src/lib/modelSelect.ts from npisb/pipecountapp-dev: direct link, hf CLI and curl.
- Browser
- Download file 502 Bytes
-
https://huggingface.co/spaces/npisb/pipecountapp-dev/resolve/main/frontend/src/lib/modelSelect.ts
- Command line
-
hf download hf://spaces/npisb/pipecountapp-dev/frontend/src/lib/modelSelect.ts
-
curl -L -o modelSelect.ts https://huggingface.co/spaces/npisb/pipecountapp-dev/resolve/main/frontend/src/lib/modelSelect.ts
502 Bytes
| import { | |
| INFERENCE_SIZE, | |
| INFERENCE_SIZE_SMALL, | |
| MODEL_640_URL, | |
| MODEL_URL, | |
| } from './constants' | |
| export function selectModelForImage(width: number, height: number): { | |
| modelUrl: string | |
| inferenceSize: number | |
| } { | |
| const maxDim = Math.max(width, height) | |
| // Prefer 1024 for pipe-end detail; 640 only for very small previews. | |
| if (maxDim <= 900) { | |
| return { modelUrl: MODEL_640_URL, inferenceSize: INFERENCE_SIZE_SMALL } | |
| } | |
| return { modelUrl: MODEL_URL, inferenceSize: INFERENCE_SIZE } | |
| } | |