Update app.py
Browse files
app.py
CHANGED
|
@@ -12,7 +12,7 @@ from backPrompt import main as main_b
|
|
| 12 |
from frontPrompt import main as main_f
|
| 13 |
|
| 14 |
model_path = "best.pt"
|
| 15 |
-
|
| 16 |
|
| 17 |
path = "OpenGVLab/InternVL2_5-4B"
|
| 18 |
model = AutoModel.from_pretrained(
|
|
@@ -51,7 +51,7 @@ def imageRotation(image):
|
|
| 51 |
def detect_document(image):
|
| 52 |
"""Detects front and back of the document using YOLO."""
|
| 53 |
image = np.array(image)
|
| 54 |
-
results =
|
| 55 |
|
| 56 |
detected_classes = set()
|
| 57 |
labels = []
|
|
|
|
| 12 |
from frontPrompt import main as main_f
|
| 13 |
|
| 14 |
model_path = "best.pt"
|
| 15 |
+
modelY = YOLO(model_path)
|
| 16 |
|
| 17 |
path = "OpenGVLab/InternVL2_5-4B"
|
| 18 |
model = AutoModel.from_pretrained(
|
|
|
|
| 51 |
def detect_document(image):
|
| 52 |
"""Detects front and back of the document using YOLO."""
|
| 53 |
image = np.array(image)
|
| 54 |
+
results = modelY(image, conf=0.85)
|
| 55 |
|
| 56 |
detected_classes = set()
|
| 57 |
labels = []
|