Update
Browse files
app.py
CHANGED
@@ -30,8 +30,12 @@ from detectron2.data.detection_utils import read_image
|
|
30 |
from detectron2.engine.defaults import DefaultPredictor
|
31 |
from detectron2.utils.visualizer import Visualizer
|
32 |
|
33 |
-
|
|
|
|
|
|
|
34 |
|
|
|
35 |
MODEL_REPO = 'hysts/Yet-Another-Anime-Segmenter'
|
36 |
MODEL_FILENAME = 'SOLOv2.pth'
|
37 |
CONFIG_FILENAME = 'SOLOv2.yaml'
|
@@ -119,11 +123,6 @@ def main():
|
|
119 |
func = functools.partial(predict, model=model)
|
120 |
func = functools.update_wrapper(func, predict)
|
121 |
|
122 |
-
repo_url = 'https://github.com/zymk9/Yet-Another-Anime-Segmenter'
|
123 |
-
title = 'zymk9/Yet-Another-Anime-Segmenter'
|
124 |
-
description = f'A demo for {repo_url}'
|
125 |
-
article = None
|
126 |
-
|
127 |
gr.Interface(
|
128 |
func,
|
129 |
[
|
@@ -143,11 +142,11 @@ def main():
|
|
143 |
gr.outputs.Image(label='Instances'),
|
144 |
gr.outputs.Image(label='Masked'),
|
145 |
],
|
146 |
-
theme=args.theme,
|
147 |
-
title=title,
|
148 |
-
description=description,
|
149 |
-
article=article,
|
150 |
examples=examples,
|
|
|
|
|
|
|
|
|
151 |
allow_screenshot=args.allow_screenshot,
|
152 |
allow_flagging=args.allow_flagging,
|
153 |
live=args.live,
|
|
|
30 |
from detectron2.engine.defaults import DefaultPredictor
|
31 |
from detectron2.utils.visualizer import Visualizer
|
32 |
|
33 |
+
ORIGINAL_REPO_URL = 'https://github.com/zymk9/Yet-Another-Anime-Segmenter'
|
34 |
+
TITLE = 'zymk9/Yet-Another-Anime-Segmenter'
|
35 |
+
DESCRIPTION = f'A demo for {ORIGINAL_REPO_URL}'
|
36 |
+
ARTICLE = None
|
37 |
|
38 |
+
TOKEN = os.environ['TOKEN']
|
39 |
MODEL_REPO = 'hysts/Yet-Another-Anime-Segmenter'
|
40 |
MODEL_FILENAME = 'SOLOv2.pth'
|
41 |
CONFIG_FILENAME = 'SOLOv2.yaml'
|
|
|
123 |
func = functools.partial(predict, model=model)
|
124 |
func = functools.update_wrapper(func, predict)
|
125 |
|
|
|
|
|
|
|
|
|
|
|
126 |
gr.Interface(
|
127 |
func,
|
128 |
[
|
|
|
142 |
gr.outputs.Image(label='Instances'),
|
143 |
gr.outputs.Image(label='Masked'),
|
144 |
],
|
|
|
|
|
|
|
|
|
145 |
examples=examples,
|
146 |
+
title=TITLE,
|
147 |
+
description=DESCRIPTION,
|
148 |
+
article=ARTICLE,
|
149 |
+
theme=args.theme,
|
150 |
allow_screenshot=args.allow_screenshot,
|
151 |
allow_flagging=args.allow_flagging,
|
152 |
live=args.live,
|