upadhyaysuraj
commited on
Commit
•
7c82941
1
Parent(s):
8f97706
Upload 3 files
Browse files- app.py +4 -0
- requirements.txt +1 -1
- setup.sh +8 -2
app.py
CHANGED
@@ -4,6 +4,9 @@ import numpy as np
|
|
4 |
from ultralytics import YOLO
|
5 |
import pytesseract
|
6 |
|
|
|
|
|
|
|
7 |
def load_model(model_path):
|
8 |
"""
|
9 |
Loads the YOLO model from the specified path.
|
@@ -94,3 +97,4 @@ iface = gr.Interface(
|
|
94 |
# Launch the Gradio app
|
95 |
if __name__ == "__main__":
|
96 |
iface.launch(share=True)
|
|
|
|
4 |
from ultralytics import YOLO
|
5 |
import pytesseract
|
6 |
|
7 |
+
# Explicitly set the Tesseract executable path
|
8 |
+
pytesseract.pytesseract.tesseract_cmd = '/usr/bin/tesseract'
|
9 |
+
|
10 |
def load_model(model_path):
|
11 |
"""
|
12 |
Loads the YOLO model from the specified path.
|
|
|
97 |
# Launch the Gradio app
|
98 |
if __name__ == "__main__":
|
99 |
iface.launch(share=True)
|
100 |
+
|
requirements.txt
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
-
tesseract
|
2 |
tensorflow
|
3 |
opencv-python
|
4 |
pytesseract
|
5 |
ultralytics
|
6 |
matplotlib
|
7 |
gradio
|
|
|
|
|
|
1 |
tensorflow
|
2 |
opencv-python
|
3 |
pytesseract
|
4 |
ultralytics
|
5 |
matplotlib
|
6 |
gradio
|
7 |
+
|
setup.sh
CHANGED
@@ -1,8 +1,14 @@
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
-
#
|
4 |
apt-get update
|
5 |
apt-get install -y tesseract-ocr
|
6 |
|
7 |
# Install necessary Python packages
|
8 |
-
pip install
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
+
# Update package list and install Tesseract OCR
|
4 |
apt-get update
|
5 |
apt-get install -y tesseract-ocr
|
6 |
|
7 |
# Install necessary Python packages
|
8 |
+
pip install tensorflow
|
9 |
+
pip install opencv-python
|
10 |
+
pip install pytesseract
|
11 |
+
pip install ultralytics
|
12 |
+
pip install matplotlib
|
13 |
+
pip install gradio
|
14 |
+
|