Spaces:
Sleeping
Sleeping
Commit
·
29bd04d
1
Parent(s):
b6be2b4
Fix JSON BOM error and correct input size to 224x224 (23 classes)
Browse files- app.py +2 -2
- models/batik_classes.json +27 -28
app.py
CHANGED
|
@@ -21,7 +21,7 @@ CORS(app)
|
|
| 21 |
model = None
|
| 22 |
class_names = None
|
| 23 |
|
| 24 |
-
def preprocess_image(image, target_size=(
|
| 25 |
"""Preprocess for VGG16-based model"""
|
| 26 |
if image.mode != 'RGB':
|
| 27 |
image = image.convert('RGB')
|
|
@@ -56,7 +56,7 @@ def index():
|
|
| 56 |
"name": "Batik Classifier API",
|
| 57 |
"model": "CNN (VGG16-based)",
|
| 58 |
"classes": len(class_names) if class_names else 0,
|
| 59 |
-
"input_size": "
|
| 60 |
"status": "ready" if model and class_names else "error"
|
| 61 |
})
|
| 62 |
|
|
|
|
| 21 |
model = None
|
| 22 |
class_names = None
|
| 23 |
|
| 24 |
+
def preprocess_image(image, target_size=(224, 224)):
|
| 25 |
"""Preprocess for VGG16-based model"""
|
| 26 |
if image.mode != 'RGB':
|
| 27 |
image = image.convert('RGB')
|
|
|
|
| 56 |
"name": "Batik Classifier API",
|
| 57 |
"model": "CNN (VGG16-based)",
|
| 58 |
"classes": len(class_names) if class_names else 0,
|
| 59 |
+
"input_size": "224x224",
|
| 60 |
"status": "ready" if model and class_names else "error"
|
| 61 |
})
|
| 62 |
|
models/batik_classes.json
CHANGED
|
@@ -1,28 +1,27 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
}
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"classes": [
|
| 3 |
+
"Aceh_Pintu_Aceh",
|
| 4 |
+
"Bali_Barong",
|
| 5 |
+
"Bali_Merak",
|
| 6 |
+
"Betawi_Tumpal",
|
| 7 |
+
"DKI_Jakarta_Ondel_Ondel",
|
| 8 |
+
"Jawa_Barat_Megamendung",
|
| 9 |
+
"Jawa_Timur_Pring",
|
| 10 |
+
"Kalimantan_Barat_Insang",
|
| 11 |
+
"Kalimantan_Dayak",
|
| 12 |
+
"Lampung_Gajah",
|
| 13 |
+
"Madura_Gentongan",
|
| 14 |
+
"Maluku_Pala",
|
| 15 |
+
"NTB_Lumbung",
|
| 16 |
+
"Papua_Asmat",
|
| 17 |
+
"Papua_Cendrawasih",
|
| 18 |
+
"Papua_Tifa",
|
| 19 |
+
"Solo_Parang",
|
| 20 |
+
"Solo_Sidoluhur",
|
| 21 |
+
"Solo_Truntum",
|
| 22 |
+
"Sulawesi_Selatan_Lontara",
|
| 23 |
+
"Sumatera_Barat_Rumah_Minang",
|
| 24 |
+
"Sumatera_Utara_Boraspati",
|
| 25 |
+
"Yogyakarta_Kawung"
|
| 26 |
+
]
|
| 27 |
+
}
|
|
|