Update app.py
Browse files
app.py
CHANGED
|
@@ -16,7 +16,7 @@ def predict_cars(img):
|
|
| 16 |
img_array = preprocess_input(img_array) # Preprocess the input as expected by ResNet50
|
| 17 |
|
| 18 |
prediction = model.predict(img_array) # Predict using the model
|
| 19 |
-
classes = ['Golf', '
|
| 20 |
return {classes[i]: float(prediction[0][i]) for i in range(3)} # Return the prediction
|
| 21 |
|
| 22 |
# Define Gradio interface
|
|
@@ -29,4 +29,3 @@ interface = gr.Interface(fn=predict_cars,
|
|
| 29 |
# Launch the interface
|
| 30 |
interface.launch()
|
| 31 |
|
| 32 |
-
#test
|
|
|
|
| 16 |
img_array = preprocess_input(img_array) # Preprocess the input as expected by ResNet50
|
| 17 |
|
| 18 |
prediction = model.predict(img_array) # Predict using the model
|
| 19 |
+
classes = ['Golf', 'RollsRoyce', 'Spark'] # Specific car models
|
| 20 |
return {classes[i]: float(prediction[0][i]) for i in range(3)} # Return the prediction
|
| 21 |
|
| 22 |
# Define Gradio interface
|
|
|
|
| 29 |
# Launch the interface
|
| 30 |
interface.launch()
|
| 31 |
|
|
|