Spaces:
Sleeping
Sleeping
aggiunto image sample
Browse files
scripts/create_sample_images.py
CHANGED
|
@@ -4,8 +4,8 @@ Script to create a sample_images directory with representative test images
|
|
| 4 |
from the MVTecAD dataset for use in the Gradio web UI.
|
| 5 |
|
| 6 |
For each category, it copies:
|
| 7 |
-
-
|
| 8 |
-
- 2
|
| 9 |
"""
|
| 10 |
|
| 11 |
import os
|
|
@@ -25,9 +25,9 @@ CATEGORIES = [
|
|
| 25 |
]
|
| 26 |
|
| 27 |
# Number of samples per type
|
| 28 |
-
NUM_GOOD_SAMPLES =
|
| 29 |
NUM_ANOMALY_SAMPLES_PER_TYPE = 2
|
| 30 |
-
MAX_ANOMALY_TYPES =
|
| 31 |
|
| 32 |
|
| 33 |
def get_anomaly_types(category_path: Path) -> list:
|
|
|
|
| 4 |
from the MVTecAD dataset for use in the Gradio web UI.
|
| 5 |
|
| 6 |
For each category, it copies:
|
| 7 |
+
- 1 good (normal) image
|
| 8 |
+
- 2 images from each anomaly type (up to 4 anomaly types per category)
|
| 9 |
"""
|
| 10 |
|
| 11 |
import os
|
|
|
|
| 25 |
]
|
| 26 |
|
| 27 |
# Number of samples per type
|
| 28 |
+
NUM_GOOD_SAMPLES = 1
|
| 29 |
NUM_ANOMALY_SAMPLES_PER_TYPE = 2
|
| 30 |
+
MAX_ANOMALY_TYPES = 4 # Maximum number of different anomaly types to include
|
| 31 |
|
| 32 |
|
| 33 |
def get_anomaly_types(category_path: Path) -> list:
|