Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ from tensorflow.keras.models import load_model
|
|
3 |
import gradio as gr
|
4 |
import cv2
|
5 |
import numpy as np
|
6 |
-
from tensorflow.keras.applications.inception_v3 import InceptionV3
|
7 |
import gdown
|
8 |
|
9 |
# Download model dari Google Drive
|
@@ -35,7 +35,7 @@ def detect_acne(image, threshold=0.4):
|
|
35 |
input_data = preprocess_input(np.expand_dims(image_resized, axis=0)) # Menambah dimensi untuk batch
|
36 |
|
37 |
# Mendapatkan prediksi dari model
|
38 |
-
predictions =
|
39 |
|
40 |
# Menemukan indeks kelas dengan probabilitas tertinggi
|
41 |
max_index = np.argmax(predictions[0]) # Indeks dengan probabilitas tertinggi
|
|
|
3 |
import gradio as gr
|
4 |
import cv2
|
5 |
import numpy as np
|
6 |
+
from tensorflow.keras.applications.inception_v3 import InceptionV3, preprocess_input
|
7 |
import gdown
|
8 |
|
9 |
# Download model dari Google Drive
|
|
|
35 |
input_data = preprocess_input(np.expand_dims(image_resized, axis=0)) # Menambah dimensi untuk batch
|
36 |
|
37 |
# Mendapatkan prediksi dari model
|
38 |
+
predictions = model.predict(input_data)
|
39 |
|
40 |
# Menemukan indeks kelas dengan probabilitas tertinggi
|
41 |
max_index = np.argmax(predictions[0]) # Indeks dengan probabilitas tertinggi
|