Spaces:
Sleeping
Sleeping
Download inference.py from NaveenKumar5/Robo_flow: direct link, hf CLI and curl.
- Browser
- Download file 385 Bytes
-
https://huggingface.co/spaces/NaveenKumar5/Robo_flow/resolve/main/inference.py
- Command line
-
hf download hf://spaces/NaveenKumar5/Robo_flow/inference.py
-
curl -L -o inference.py https://huggingface.co/spaces/NaveenKumar5/Robo_flow/resolve/main/inference.py
385 Bytes
| from roboflow import Roboflow | |
| from PIL import Image | |
| import numpy as np | |
| # Load Roboflow model | |
| rf = Roboflow(api_key="rSfidObyvZ1BYV7yOQrN") | |
| project = rf.workspace("naveen-kumar-9emxl").project("my-first-project-icheu") | |
| model = project.version(1).model | |
| def predict(image): | |
| image = np.array(image) | |
| prediction = model.predict(image).plot() | |
| return Image.fromarray(prediction) | |