melakukan load langsung di repo model app.py dan menambahkan YAML di README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
# HistoryLens - Capstone DBS Coding Camp
|
2 |
|
3 |
Proyek ini adalah aplikasi klasifikasi gambar berbasis deep learning untuk mengenali situs cagar budaya di Daerah Istimewa Yogyakarta (DIY). Dibuat menggunakan Gradio dan TensorFlow/Keras, ditujukan untuk membantu pengguna mengenali tempat bersejarah hanya dengan mengunggah foto.
|
|
|
1 |
+
---
|
2 |
+
title: HistoryLens
|
3 |
+
emoji: 👍
|
4 |
+
colorFrom: purple
|
5 |
+
colorTo: red
|
6 |
+
sdk: gradio
|
7 |
+
sdk_version: 5.33.0
|
8 |
+
app_file: app.py
|
9 |
+
pinned: false
|
10 |
+
license: apache-2.0
|
11 |
+
short_description: Classification Image using MobileNetV2
|
12 |
+
metrics:
|
13 |
+
- accuracy
|
14 |
+
pipeline_tag: image-classification
|
15 |
+
library_name: keras
|
16 |
+
tags:
|
17 |
+
- capstone
|
18 |
+
- image-classification
|
19 |
+
- keras
|
20 |
+
- computer-vision
|
21 |
+
- gradio
|
22 |
+
- historycal-sites
|
23 |
+
- tensorflow
|
24 |
+
datasets:
|
25 |
+
- custom
|
26 |
+
---
|
27 |
+
|
28 |
# HistoryLens - Capstone DBS Coding Camp
|
29 |
|
30 |
Proyek ini adalah aplikasi klasifikasi gambar berbasis deep learning untuk mengenali situs cagar budaya di Daerah Istimewa Yogyakarta (DIY). Dibuat menggunakan Gradio dan TensorFlow/Keras, ditujukan untuk membantu pengguna mengenali tempat bersejarah hanya dengan mengunggah foto.
|
app.py
CHANGED
@@ -13,6 +13,8 @@ from tensorflow.keras.preprocessing import image
|
|
13 |
from tensorflow.keras.models import model_from_json
|
14 |
from PIL import Image
|
15 |
|
|
|
|
|
16 |
from description import description
|
17 |
from location import location
|
18 |
|
@@ -23,7 +25,11 @@ def load_model_from_file(json_path, h5_path):
|
|
23 |
model.load_weights(h5_path)
|
24 |
return model
|
25 |
|
26 |
-
|
|
|
|
|
|
|
|
|
27 |
|
28 |
labels = [
|
29 |
"Benteng Vredeburg", "Candi Borobudur", "Candi Prambanan", "Gedung Agung Istana Kepresidenan",
|
|
|
13 |
from tensorflow.keras.models import model_from_json
|
14 |
from PIL import Image
|
15 |
|
16 |
+
from huggingface_hub import hf_hub_download
|
17 |
+
|
18 |
from description import description
|
19 |
from location import location
|
20 |
|
|
|
25 |
model.load_weights(h5_path)
|
26 |
return model
|
27 |
|
28 |
+
# Load model langsung dari Hugging Face Hub
|
29 |
+
model_json_path = hf_hub_download(repo_id="CapstoneML/Model", filename="model.json")
|
30 |
+
model_weights_path = hf_hub_download(repo_id="CapstoneML/Model", filename="my_model.h5")
|
31 |
+
|
32 |
+
model = load_model_from_file(model_json_path, model_weights_path)
|
33 |
|
34 |
labels = [
|
35 |
"Benteng Vredeburg", "Candi Borobudur", "Candi Prambanan", "Gedung Agung Istana Kepresidenan",
|