JKrishnanandhaa commited on
Commit
b8dcf5d
·
verified ·
1 Parent(s): 47c72b6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -114,6 +114,10 @@ class ForgeryDetector:
114
  [f.cpu() for f in decoder_features]
115
  )
116
 
 
 
 
 
117
  # Classify
118
  predictions, confidences = self.classifier.predict(features)
119
  forgery_type = int(predictions[0])
 
114
  [f.cpu() for f in decoder_features]
115
  )
116
 
117
+ # Reshape features to 2D array (1, n_features) for classifier
118
+ if features.ndim == 1:
119
+ features = features.reshape(1, -1)
120
+
121
  # Classify
122
  predictions, confidences = self.classifier.predict(features)
123
  forgery_type = int(predictions[0])