File size: 1,731 Bytes
90b4364
 
 
 
92125df
312aecc
90b4364
92125df
 
 
 
 
528f68e
92125df
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
312aecc
 
 
 
3903f4f
90b4364
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import os

import gradio as gr

from detection import EyesDetection, FaceDetection, HeadDetection, PersonDetection, HandDetection, CensorDetection, \
    HalfBodyDetection, NudeNetDetection, BooruYOLODetection

_GLOBAL_CSS = """
.limit-height {
    max-height: 55vh;
}
"""

if __name__ == '__main__':
    with gr.Blocks(css=_GLOBAL_CSS) as demo:
        with gr.Row():
            with gr.Column():
                gr.HTML('<h2 style="text-align: center;">Object Detections For Anime</h2>')
                gr.Markdown('This is the online demo for detection functions of '
                            '[imgutils.detect](https://dghs-imgutils.deepghs.org/main/api_doc/detect/index.html). '
                            'You can try them yourselves with `pip install dghs-imgutils`.')

        with gr.Row():
            with gr.Tabs():
                with gr.Tab('Face Detection'):
                    FaceDetection().make_ui()
                with gr.Tab('Head Detection'):
                    HeadDetection().make_ui()
                with gr.Tab('Person Detection'):
                    PersonDetection().make_ui()
                with gr.Tab('Half Body Detection'):
                    HalfBodyDetection().make_ui()
                with gr.Tab('Eyes Detection'):
                    EyesDetection().make_ui()
                with gr.Tab('Hand Detection'):
                    HandDetection().make_ui()
                with gr.Tab('Censor Point Detection'):
                    CensorDetection().make_ui()
                with gr.Tab('NudeNet'):
                    NudeNetDetection().make_ui()
                with gr.Tab('BooruYOLO'):
                    BooruYOLODetection().make_ui()

    demo.queue(os.cpu_count()).launch()