Spaces:
Running
on
Zero
Running
on
Zero
Update
Browse files
app.py
CHANGED
@@ -21,8 +21,12 @@ from models.yolo import Model
|
|
21 |
from utils.datasets import letterbox
|
22 |
from utils.general import non_max_suppression, scale_coords
|
23 |
|
24 |
-
|
|
|
|
|
|
|
25 |
|
|
|
26 |
MODEL_REPO = 'hysts/yolov5_anime'
|
27 |
MODEL_FILENAME = 'yolov5x_anime.pth'
|
28 |
CONFIG_FILENAME = 'yolov5x.yaml'
|
@@ -125,11 +129,6 @@ def main():
|
|
125 |
func = functools.partial(predict, device=device, model=model)
|
126 |
func = functools.update_wrapper(func, predict)
|
127 |
|
128 |
-
repo_url = 'https://github.com/zymk9/yolov5_anime'
|
129 |
-
title = 'zymk9/yolov5_anime'
|
130 |
-
description = f'A demo for {repo_url}'
|
131 |
-
article = None
|
132 |
-
|
133 |
gr.Interface(
|
134 |
func,
|
135 |
[
|
@@ -146,11 +145,11 @@ def main():
|
|
146 |
label='IoU Threshold'),
|
147 |
],
|
148 |
gr.outputs.Image(label='Output'),
|
149 |
-
theme=args.theme,
|
150 |
-
title=title,
|
151 |
-
description=description,
|
152 |
-
article=article,
|
153 |
examples=examples,
|
|
|
|
|
|
|
|
|
154 |
allow_screenshot=args.allow_screenshot,
|
155 |
allow_flagging=args.allow_flagging,
|
156 |
live=args.live,
|
|
|
21 |
from utils.datasets import letterbox
|
22 |
from utils.general import non_max_suppression, scale_coords
|
23 |
|
24 |
+
ORIGINAL_REPO_URL = 'https://github.com/zymk9/yolov5_anime'
|
25 |
+
TITLE = 'zymk9/yolov5_anime'
|
26 |
+
DESCRIPTION = f'A demo for {ORIGINAL_REPO_URL}'
|
27 |
+
ARTICLE = None
|
28 |
|
29 |
+
TOKEN = os.environ['TOKEN']
|
30 |
MODEL_REPO = 'hysts/yolov5_anime'
|
31 |
MODEL_FILENAME = 'yolov5x_anime.pth'
|
32 |
CONFIG_FILENAME = 'yolov5x.yaml'
|
|
|
129 |
func = functools.partial(predict, device=device, model=model)
|
130 |
func = functools.update_wrapper(func, predict)
|
131 |
|
|
|
|
|
|
|
|
|
|
|
132 |
gr.Interface(
|
133 |
func,
|
134 |
[
|
|
|
145 |
label='IoU Threshold'),
|
146 |
],
|
147 |
gr.outputs.Image(label='Output'),
|
|
|
|
|
|
|
|
|
148 |
examples=examples,
|
149 |
+
title=TITLE,
|
150 |
+
description=DESCRIPTION,
|
151 |
+
article=ARTICLE,
|
152 |
+
theme=args.theme,
|
153 |
allow_screenshot=args.allow_screenshot,
|
154 |
allow_flagging=args.allow_flagging,
|
155 |
live=args.live,
|