Spaces:
Running
Running
Francisco Cerna
commited on
Commit
·
797e8aa
1
Parent(s):
69db545
Update app.py
Browse files
app.py
CHANGED
@@ -45,18 +45,13 @@ torch.hub.download_url_to_file('https://i.pinimg.com/originals/c2/ce/e0/c2cee056
|
|
45 |
|
46 |
# Model
|
47 |
#model = torch.hub.load('ultralytics/yolov5', 'yolov5s') # force_reload=True to update
|
48 |
-
|
49 |
#model = torch.hub.load('ultralytics/yolov5', 'custom', path='best.pt') # local model o google colab
|
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 |
model = torch.hub.load('ultralytics/yolov5', 'custom', path='best.pt', force_reload=True, autoshape=True, trust_repo=True)
|
53 |
|
54 |
-
|
55 |
-
|
56 |
-
#hf_writer = gr.HuggingFaceDatasetSaver(hf_foken=HF_TOKEN, dataset_name="AllAideas/demo-iazika-flags")
|
57 |
-
#hf_writer = gr.HuggingFaceDatasetSaver(HF_TOKEN, "AllAideas/demo-iazika-flags", "AllAideas")
|
58 |
-
hf_writer = gr.HuggingFaceDatasetSaver(hf_foken=HF_TOKEN, dataset_name="AllAideas/demo-iazika-flags", organization="AllAideas", private=True)
|
59 |
-
#hf_writer = gr.HuggingFaceDatasetSaver(HF_TOKEN, "demo-iazika-flags", "AllAideas", False)
|
60 |
|
61 |
def getQuantity(string):
|
62 |
contador_raw = ''.join(string.split(" ")[3:])
|
@@ -150,7 +145,6 @@ iface = gr.Interface(yolo,
|
|
150 |
allow_flagging="manual",
|
151 |
flagging_options=["Correcto", "Incorrecto", "Casi correcto", "Error", "Otro"],
|
152 |
#flagging_callback=hf_writer
|
153 |
-
flagging_callback=gr.CSVLogger()
|
154 |
)
|
155 |
|
156 |
#iface.launch(cache_examples=True, enable_queue=True, debug=True)
|
|
|
45 |
|
46 |
# Model
|
47 |
#model = torch.hub.load('ultralytics/yolov5', 'yolov5s') # force_reload=True to update
|
|
|
48 |
#model = torch.hub.load('ultralytics/yolov5', 'custom', path='best.pt') # local model o google colab
|
49 |
#model = torch.hub.load('ultralytics/yolov5', 'custom', path='best.pt', force_reload=True, autoshape=True) # local model o google colab
|
50 |
#model = torch.hub.load('path/to/yolov5', 'custom', path='/content/yolov56.pt', source='local') # local repo
|
51 |
model = torch.hub.load('ultralytics/yolov5', 'custom', path='best.pt', force_reload=True, autoshape=True, trust_repo=True)
|
52 |
|
53 |
+
HF_TOKEN = os.getenv("ZIKA_TOKEN_WRITE")
|
54 |
+
hf_writer = gr.HuggingFaceDatasetSaver(hf_foken=HF_TOKEN, dataset_name="AllAideas/demo-iazika-flags")
|
|
|
|
|
|
|
|
|
55 |
|
56 |
def getQuantity(string):
|
57 |
contador_raw = ''.join(string.split(" ")[3:])
|
|
|
145 |
allow_flagging="manual",
|
146 |
flagging_options=["Correcto", "Incorrecto", "Casi correcto", "Error", "Otro"],
|
147 |
#flagging_callback=hf_writer
|
|
|
148 |
)
|
149 |
|
150 |
#iface.launch(cache_examples=True, enable_queue=True, debug=True)
|