Update app.py
Browse files
app.py
CHANGED
@@ -29,6 +29,9 @@ yolo_model = project.version(model_version).model
|
|
29 |
# ========== Fungsi Deteksi Kombinasi ==========
|
30 |
from PIL import Image
|
31 |
|
|
|
|
|
|
|
32 |
# Fungsi untuk deteksi dengan resize
|
33 |
def detect_combined(image):
|
34 |
# Simpan gambar input ke file sementara
|
@@ -39,7 +42,7 @@ def detect_combined(image):
|
|
39 |
try:
|
40 |
# Resize gambar input menjadi 640x640
|
41 |
img = Image.open(temp_path)
|
42 |
-
img = img.resize((640, 640), Image.ANTIALIAS
|
43 |
img.save(temp_path, format="JPEG")
|
44 |
|
45 |
# ========== [1] YOLO: Deteksi Produk Nestlé (Per Class) ==========
|
|
|
29 |
# ========== Fungsi Deteksi Kombinasi ==========
|
30 |
from PIL import Image
|
31 |
|
32 |
+
# Fungsi untuk deteksi dengan resize
|
33 |
+
from PIL import Image
|
34 |
+
|
35 |
# Fungsi untuk deteksi dengan resize
|
36 |
def detect_combined(image):
|
37 |
# Simpan gambar input ke file sementara
|
|
|
42 |
try:
|
43 |
# Resize gambar input menjadi 640x640
|
44 |
img = Image.open(temp_path)
|
45 |
+
img = img.resize((640, 640), Image.Resampling.LANCZOS) # Ganti ANTIALIAS dengan LANCZOS
|
46 |
img.save(temp_path, format="JPEG")
|
47 |
|
48 |
# ========== [1] YOLO: Deteksi Produk Nestlé (Per Class) ==========
|