Image Classification
Transformers
Safetensors
nula
computer-vision
cnn
cifar10
adversarial-robustness
stress-test
downsampling
anti-aliasing
custom_code
Instructions to use MamaPearl/nula-cifar10-robust-v0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MamaPearl/nula-cifar10-robust-v0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="MamaPearl/nula-cifar10-robust-v0", trust_remote_code=True) pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# Load model directly from transformers import AutoModelForImageClassification model = AutoModelForImageClassification.from_pretrained("MamaPearl/nula-cifar10-robust-v0", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update infer.py
Browse files
infer.py
CHANGED
|
@@ -34,7 +34,7 @@ def predict(model, image_source: str, device: str = "cpu") -> dict:
|
|
| 34 |
|
| 35 |
if __name__ == "__main__":
|
| 36 |
import sys
|
| 37 |
-
source = sys.argv[1] if len(sys.argv) > 1 else "https://upload.wikimedia.org/wikipedia/commons/a/a7/Camponotus_flavomarginatus_ant.jpg"
|
| 38 |
|
| 39 |
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
| 40 |
|
|
|
|
| 34 |
|
| 35 |
if __name__ == "__main__":
|
| 36 |
import sys
|
| 37 |
+
source = sys.argv[1] if len(sys.argv) > 1 else "https://upload.wikimedia.org/wikipedia/commons/a/a7/Camponotus_flavomarginatus_ant.jpg"
|
| 38 |
|
| 39 |
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
| 40 |
|