Download test_yolo_api.py from Agri-Tech/Testing-Pipeline-API: direct link, hf CLI and curl.
- Browser
- Download file 515 Bytes
-
https://huggingface.co/spaces/Agri-Tech/Testing-Pipeline-API/resolve/refs%2Fpr%2F13/test_yolo_api.py
- Command line
-
hf download hf://spaces/Agri-Tech/Testing-Pipeline-API@refs/pr/13/test_yolo_api.py
-
curl -L -o test_yolo_api.py https://huggingface.co/spaces/Agri-Tech/Testing-Pipeline-API/resolve/refs%2Fpr%2F13/test_yolo_api.py
515 Bytes
| import requests | |
| # Path to your 4-channel TIFF image | |
| file_path = r"D:\AgriTech\Agri-Drone\fc_regress_train\train\images\IMG_0009.tif" | |
| # API endpoint | |
| url = "https://agri-tech-testing-pipeline-api.hf.space/predict_yolo/" | |
| # Send the POST request with the image file | |
| with open(file_path, "rb") as f: | |
| files = {"file": (file_path.split("\\")[-1], f, "image/tiff")} | |
| response = requests.post(url, files=files) | |
| # Print response | |
| print("Status Code:", response.status_code) | |
| print("Response JSON:", response.json()) | |