Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,16 +8,13 @@ from huggingface_hub import from_pretrained_fastai
|
|
| 8 |
|
| 9 |
# Instantiate classification model
|
| 10 |
from fastai.vision.all import *
|
| 11 |
-
|
| 12 |
-
repo_id = "zklee98/vit_tiny_patch16_multi"
|
| 13 |
-
model_multi = from_pretrained_fastai(repo_id)
|
| 14 |
|
| 15 |
def binary_label(path):
|
| 16 |
return 'No-anomaly' if (parent_label(path) == 'No-Anomaly') else 'Anomaly'
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
# Instantiate segmentation model
|
| 22 |
from transformers import SegformerFeatureExtractor, SegformerForSemanticSegmentation
|
| 23 |
from torchvision.transforms import Grayscale
|
|
|
|
| 8 |
|
| 9 |
# Instantiate classification model
|
| 10 |
from fastai.vision.all import *
|
| 11 |
+
model_multi = load_learner('vit_tiny_patch16.pkl')
|
|
|
|
|
|
|
| 12 |
|
| 13 |
def binary_label(path):
|
| 14 |
return 'No-anomaly' if (parent_label(path) == 'No-Anomaly') else 'Anomaly'
|
| 15 |
|
| 16 |
+
model_binary = load_learner('vit_tiny_patch16_binary.pkl')
|
| 17 |
+
|
|
|
|
| 18 |
# Instantiate segmentation model
|
| 19 |
from transformers import SegformerFeatureExtractor, SegformerForSemanticSegmentation
|
| 20 |
from torchvision.transforms import Grayscale
|