Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -414,9 +414,10 @@ class ForgeryDetector:
|
|
| 414 |
|
| 415 |
region_mask = region_mask.astype(bool)
|
| 416 |
|
| 417 |
-
# Extract features
|
|
|
|
| 418 |
features = self.feature_extractor.extract(
|
| 419 |
-
|
| 420 |
region['region_mask'],
|
| 421 |
[f.cpu() for f in decoder_features]
|
| 422 |
)
|
|
|
|
| 414 |
|
| 415 |
region_mask = region_mask.astype(bool)
|
| 416 |
|
| 417 |
+
# Extract features using ORIGINAL image (not preprocessed)
|
| 418 |
+
# This matches how the classifier was trained
|
| 419 |
features = self.feature_extractor.extract(
|
| 420 |
+
original_image / 255.0, # Normalize to [0, 1]
|
| 421 |
region['region_mask'],
|
| 422 |
[f.cpu() for f in decoder_features]
|
| 423 |
)
|