Spaces:
Runtime error
Runtime error
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/a34f5755f8fee2e18fc00a54ec4d76811bf2def0/frontend/src/lib/modelSelect.ts
- Command line
-
hf download hf://spaces/npisb/pipecountapp-dev@a34f5755f8fee2e18fc00a54ec4d76811bf2def0/frontend/src/lib/modelSelect.ts
-
curl -L -o modelSelect.ts https://huggingface.co/spaces/npisb/pipecountapp-dev/resolve/a34f5755f8fee2e18fc00a54ec4d76811bf2def0/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) | |
| // Use 1024 for most production photos; 640 only for small previews. | |
| if (maxDim <= 1200) { | |
| return { modelUrl: MODEL_640_URL, inferenceSize: INFERENCE_SIZE_SMALL } | |
| } | |
| return { modelUrl: MODEL_URL, inferenceSize: INFERENCE_SIZE } | |
| } | |