Update app.py
Browse files
app.py
CHANGED
|
@@ -50,7 +50,11 @@ if uploaded_file:
|
|
| 50 |
if st.button("Generate Style"):
|
| 51 |
compiled_model, input_layer, output_layer = load_model(style)
|
| 52 |
input_tensor = preprocess(image)
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
result = postprocess(output)
|
| 55 |
result_pil = Image.fromarray(result)
|
| 56 |
col2.image(result_pil, caption=f"{style} Style", use_column_width=True)
|
|
|
|
| 50 |
if st.button("Generate Style"):
|
| 51 |
compiled_model, input_layer, output_layer = load_model(style)
|
| 52 |
input_tensor = preprocess(image)
|
| 53 |
+
|
| 54 |
+
# ✅ Correct inference syntax
|
| 55 |
+
result_dict = compiled_model.infer({input_layer: input_tensor})
|
| 56 |
+
output = result_dict[output_layer]
|
| 57 |
+
|
| 58 |
result = postprocess(output)
|
| 59 |
result_pil = Image.fromarray(result)
|
| 60 |
col2.image(result_pil, caption=f"{style} Style", use_column_width=True)
|