Spaces:
Runtime error
Runtime error
Download python_usage.txt from taskswithcode/salient-object-detection: direct link, hf CLI and curl.
- Browser
- Download file 350 Bytes
-
https://huggingface.co/spaces/taskswithcode/salient-object-detection/resolve/main/python_usage.txt
- Command line
-
hf download hf://spaces/taskswithcode/salient-object-detection/python_usage.txt
-
curl -L -o python_usage.txt https://huggingface.co/spaces/taskswithcode/salient-object-detection/resolve/main/python_usage.txt
350 Bytes
| import requests | |
| <br/> | |
| file_data = open("sample.jpg", "rb") <br/> | |
| mask_type="blur" #rgba,green,blur,map <br/> | |
| r = requests.post("https://www.taskswithcode.com/salient_object_detection_api/", <br/> | |
| data={"mask":mask_type}, files={"test":file_data}) <br/> | |
| results = {"response":r.content,"size":len(r.content)} <br/> | |