Fanu2 commited on
Commit
a018a8e
·
verified ·
1 Parent(s): f9536f8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
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
- output = compiled_model([input_tensor])[output_layer]
 
 
 
 
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)