DFisch commited on
Commit
f3ef496
·
verified ·
1 Parent(s): 82c22e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -25,7 +25,17 @@ def check_forgery_df(img):
25
  x = np.expand_dims( img.astype('float32')/255., axis=0 )
26
 
27
  pred1 = model_M1.predict(x, verbose=0)
28
- pred2= model_M2.predict(x, verbose=0)
 
 
 
 
 
 
 
 
 
 
29
  pred = np.max([pred1,pred2], axis=0)
30
 
31
  pred = dfutils.create_mask(pred)
 
25
  x = np.expand_dims( img.astype('float32')/255., axis=0 )
26
 
27
  pred1 = model_M1.predict(x, verbose=0)
28
+ pred2= model_M2.predict(x, verbose=0)
29
+
30
+
31
+ # Ensure pred1 and pred2 are numpy arrays before proceeding
32
+ if isinstance(pred1, dict):
33
+ print("pred1 is dict!")
34
+ pred1 = pred1[next(iter(pred1))]
35
+ if isinstance(pred2, dict):
36
+ pred2 = pred2[next(iter(pred2))]
37
+
38
+
39
  pred = np.max([pred1,pred2], axis=0)
40
 
41
  pred = dfutils.create_mask(pred)