Spaces:
Running
Running
Francisco Cerna Fukuzaki
commited on
Commit
·
552f561
1
Parent(s):
3e01112
Save dataset.
Browse files
app.py
CHANGED
@@ -50,6 +50,9 @@ torch.hub.download_url_to_file('https://i.pinimg.com/originals/c2/ce/e0/c2cee056
|
|
50 |
model = torch.hub.load('ultralytics/yolov5', 'custom', path='best.pt', force_reload=True, autoshape=True) # local model o google colab
|
51 |
#model = torch.hub.load('path/to/yolov5', 'custom', path='/content/yolov56.pt', source='local') # local repo
|
52 |
|
|
|
|
|
|
|
53 |
def getQuantity(string):
|
54 |
contador_raw = ''.join(string.split(" ")[3:])
|
55 |
|
@@ -132,16 +135,18 @@ article ="<p style='text-align: center'><a href='https://docs.google.com/present
|
|
132 |
examples = [['640',0.45, 0.75,'ejemplo1.jpg'], ['640',0.45, 0.75,'ejemplo2.jpg']]
|
133 |
|
134 |
iface = gr.Interface(yolo,
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
|
|
|
|
145 |
|
146 |
"""For YOLOv5 PyTorch Hub inference with **PIL**, **OpenCV**, **Numpy** or **PyTorch** inputs please see the full [YOLOv5 PyTorch Hub Tutorial](https://github.com/ultralytics/yolov5/issues/36).
|
147 |
|
|
|
50 |
model = torch.hub.load('ultralytics/yolov5', 'custom', path='best.pt', force_reload=True, autoshape=True) # local model o google colab
|
51 |
#model = torch.hub.load('path/to/yolov5', 'custom', path='/content/yolov56.pt', source='local') # local repo
|
52 |
|
53 |
+
HF_TOKEN = os.getenv("ZIKA_TOKEN_WRITE")
|
54 |
+
hf_writer = gr.HuggingFaceDatasetSaver(hf_foken=HF_TOKEN, dataset_name="demo-iazika-flags")
|
55 |
+
|
56 |
def getQuantity(string):
|
57 |
contador_raw = ''.join(string.split(" ")[3:])
|
58 |
|
|
|
135 |
examples = [['640',0.45, 0.75,'ejemplo1.jpg'], ['640',0.45, 0.75,'ejemplo2.jpg']]
|
136 |
|
137 |
iface = gr.Interface(yolo,
|
138 |
+
inputs=[in1, in2, in3, in4],
|
139 |
+
outputs=[out2,out3,out4], title=title,
|
140 |
+
description=description,
|
141 |
+
article=article,
|
142 |
+
examples=examples,
|
143 |
+
theme="huggingface",
|
144 |
+
analytics_enabled=False,
|
145 |
+
allow_flagging="manual",
|
146 |
+
flagging_options=["Correcto", "Incorrecto", "Casi correcto", "Error", "Otro"],
|
147 |
+
flagging_callback=hf_writer)
|
148 |
+
|
149 |
+
iface.launch(enable_queue=True, debug=True)
|
150 |
|
151 |
"""For YOLOv5 PyTorch Hub inference with **PIL**, **OpenCV**, **Numpy** or **PyTorch** inputs please see the full [YOLOv5 PyTorch Hub Tutorial](https://github.com/ultralytics/yolov5/issues/36).
|
152 |
|