Spaces:
Runtime error
Runtime error
Commit
·
212688f
1
Parent(s):
9d6d697
Update app.py
Browse files
app.py
CHANGED
@@ -23,9 +23,8 @@ os.system("wget https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolo
|
|
23 |
os.system("wget https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-e6.pt")
|
24 |
pipeline = keras_ocr.pipeline.Pipeline()
|
25 |
|
26 |
-
def detect_Custom(img,
|
27 |
-
|
28 |
-
model='best' # Naming Convention for yolov7 See output file of https://www.kaggle.com/code/owaiskhan9654/training-yolov7-on-kaggle-on-custom-dataset/data
|
29 |
parser = argparse.ArgumentParser()
|
30 |
parser.add_argument('--weights', nargs='+', type=str, default=model+".pt", help='model.pt path(s)')
|
31 |
parser.add_argument('--source', type=str, default='Inference/', help='source')
|
@@ -184,4 +183,4 @@ examples1=[["Image1.jpeg", "Yolo_v7_Custom_trained_By_Owais"],["Image2.jpeg", "Y
|
|
184 |
Top_Title="<center>Intelligent Image to Text - IIT </center></a>"
|
185 |
|
186 |
css = ".output-image, .input-image, .image-preview {height: 300px !important}"
|
187 |
-
gr.Interface(detect_Custom,[gr.Image(type="pil"),gr.
|
|
|
23 |
os.system("wget https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-e6.pt")
|
24 |
pipeline = keras_ocr.pipeline.Pipeline()
|
25 |
|
26 |
+
def detect_Custom(img,boundedImage):
|
27 |
+
model='best' # Naming Convention for yolov7 See output file of https://www.kaggle.com/code/owaiskhan9654/training-yolov7-on-kaggle-on-custom-dataset/data
|
|
|
28 |
parser = argparse.ArgumentParser()
|
29 |
parser.add_argument('--weights', nargs='+', type=str, default=model+".pt", help='model.pt path(s)')
|
30 |
parser.add_argument('--source', type=str, default='Inference/', help='source')
|
|
|
183 |
Top_Title="<center>Intelligent Image to Text - IIT </center></a>"
|
184 |
|
185 |
css = ".output-image, .input-image, .image-preview {height: 300px !important}"
|
186 |
+
gr.Interface(detect_Custom,[gr.Image(type="pil"),gr.Image(type="filepath")],[gr.Image(type="pil"),output],css=css,title=Top_Title,examples=examples1,description=Custom_description,article=Footer,cache_examples=False).launch()
|