Spaces:
Runtime error
Runtime error
Commit History
-
Create app.py
Verified signatureimport gradio as gr import tensorflow as tf import numpy as np from PIL import Image # ================================================================= # Модельді жүктеу үшін жолды көрсету # СЕНІҢ МОДЕЛЬ АТАУЫҢ 'model.h5' БОЛУЫ КЕРЕК # ================================================================= MODEL_PATH = 'model.h5' try: model = tf.keras.models.load_model(MODEL_PATH) MODEL_LOADED = True except Exception as e: print(f"Модельді жүктеу қатесі: {e}") # Егер модель жүктелмесе, жалған (dummy) функцияны қолданамыз MODEL_LOADED = False # Класс атаулары (Colab-тағыдай) CLASS_NAMES = ['Empty', 'Full'] IMG_SIZE = (224, 224) def classify_trash_bin(image): # Егер модель жүктелмесе, қате туралы хабар береміз if not MODEL_LOADED: return {"Модель жүктелмеді": 1.0} # Суретті өңдеу if image is None: return {CLASS_NAMES[0]: 0.5, CLASS_NAMES[1]: 0.5} # Бос нәтиже img = Image.fromarray(image).convert('RGB') img = img.resize(IMG_SIZE)…5ae6856 -
Upload huggingface_model_files (1).zip
Verified signatureb331d87 -
Upload huggingface_model_files.zip
Verified signaturecbe95c3 -
initial commit
Verified signature1974ce2