Download scripts/check_backend.py from Kartikeym2007/salescode-recapture-detector: direct link, hf CLI and curl.
- Browser
- Download file 510 Bytes
-
https://huggingface.co/spaces/Kartikeym2007/salescode-recapture-detector/resolve/main/scripts/check_backend.py
- Command line
-
hf download hf://spaces/Kartikeym2007/salescode-recapture-detector/scripts/check_backend.py
-
curl -L -o check_backend.py https://huggingface.co/spaces/Kartikeym2007/salescode-recapture-detector/resolve/main/scripts/check_backend.py
510 Bytes
| import requests | |
| img_path = 'dataset/my_photos/real/WhatsApp Image 2026-06-30 at 4.09.45 PM.jpeg' | |
| with open(img_path, 'rb') as f: | |
| r = requests.post('http://127.0.0.1:8000/predict', files={'file': ('test.jpeg', f, 'image/jpeg')}) | |
| d = r.json() | |
| print("Backend score:", d["score"]) | |
| print("Backend threshold:", d["threshold"]) | |
| print("Backend model_type:", d["model_type"]) | |
| print("Backend rule_boost_total:", d["rule_boost_total"]) | |
| print("Backend raw_model_score:", d["raw_model_score"]) | |