Update app.py
Browse files
app.py
CHANGED
@@ -36,7 +36,7 @@ tokenizer = AutoTokenizer.from_pretrained(
|
|
36 |
)
|
37 |
|
38 |
|
39 |
-
def preprocessing(image, image_size=
|
40 |
"""
|
41 |
Apply enhancement filters and pad the image to match the target size while keeping full content.
|
42 |
"""
|
@@ -128,7 +128,7 @@ def vision_ai_api(image, doc_type):
|
|
128 |
|
129 |
def predict(image):
|
130 |
"""Pipeline: Preprocess -> Detect -> Crop -> Vision AI API."""
|
131 |
-
processed_image =
|
132 |
rotated_image = imageRotation(processed_image) # Placeholder for rotation
|
133 |
detected_image, labels, bounding_boxes = detect_document(rotated_image)
|
134 |
|
|
|
36 |
)
|
37 |
|
38 |
|
39 |
+
def preprocessing(image, image_size=800):
|
40 |
"""
|
41 |
Apply enhancement filters and pad the image to match the target size while keeping full content.
|
42 |
"""
|
|
|
128 |
|
129 |
def predict(image):
|
130 |
"""Pipeline: Preprocess -> Detect -> Crop -> Vision AI API."""
|
131 |
+
processed_image = preprocessing(image)
|
132 |
rotated_image = imageRotation(processed_image) # Placeholder for rotation
|
133 |
detected_image, labels, bounding_boxes = detect_document(rotated_image)
|
134 |
|