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 augmentations.py
Browse files- augmentations.py +1 -4
augmentations.py
CHANGED
|
@@ -29,10 +29,7 @@ def blur_decimate(x, blur):
|
|
| 29 |
x_down = blur(x)
|
| 30 |
return F.interpolate(x_down, size=(H,W), mode="bilinear", align_corners=False)
|
| 31 |
|
| 32 |
-
def checkerboard_alias_attack(
|
| 33 |
-
x: pt.Tensor,
|
| 34 |
-
epsilon: float=0.5,
|
| 35 |
-
):
|
| 36 |
# injects high-frequency noise that mimics sampling artifacts
|
| 37 |
_val_invars(x, epsilon=epsilon, type="attack")
|
| 38 |
B, C, H, W = x.shape
|
|
|
|
| 29 |
x_down = blur(x)
|
| 30 |
return F.interpolate(x_down, size=(H,W), mode="bilinear", align_corners=False)
|
| 31 |
|
| 32 |
+
def checkerboard_alias_attack(x, epsilon=0.5):
|
|
|
|
|
|
|
|
|
|
| 33 |
# injects high-frequency noise that mimics sampling artifacts
|
| 34 |
_val_invars(x, epsilon=epsilon, type="attack")
|
| 35 |
B, C, H, W = x.shape
|