hysts HF staff commited on
Commit
10f851e
β€’
1 Parent(s): 18ce2cc
app.py CHANGED
@@ -30,17 +30,17 @@ for name in names:
30
  continue
31
  subprocess.run(shlex.split(command), cwd='ControlNet/annotator/ckpts/')
32
 
33
- from gradio_canny2image import create_demo as create_demo_canny
34
- from gradio_depth2image import create_demo as create_demo_depth
35
- from gradio_fake_scribble2image import create_demo as create_demo_fake_scribble
36
- from gradio_hed2image import create_demo as create_demo_hed
37
- from gradio_hough2image import create_demo as create_demo_hough
38
- from gradio_normal2image import create_demo as create_demo_normal
39
- from gradio_pose2image import create_demo as create_demo_pose
40
- from gradio_scribble2image import create_demo as create_demo_scribble
41
- from gradio_scribble2image_interactive import \
42
  create_demo as create_demo_scribble_interactive
43
- from gradio_seg2image import create_demo as create_demo_seg
44
  from model import Model
45
 
46
  DESCRIPTION = '''# ControlNet
 
30
  continue
31
  subprocess.run(shlex.split(command), cwd='ControlNet/annotator/ckpts/')
32
 
33
+ from app_canny import create_demo as create_demo_canny
34
+ from app_depth import create_demo as create_demo_depth
35
+ from app_fake_scribble import create_demo as create_demo_fake_scribble
36
+ from app_hed import create_demo as create_demo_hed
37
+ from app_hough import create_demo as create_demo_hough
38
+ from app_normal import create_demo as create_demo_normal
39
+ from app_pose import create_demo as create_demo_pose
40
+ from app_scribble import create_demo as create_demo_scribble
41
+ from app_scribble_interactive import \
42
  create_demo as create_demo_scribble_interactive
43
+ from app_seg import create_demo as create_demo_seg
44
  from model import Model
45
 
46
  DESCRIPTION = '''# ControlNet
gradio_canny2image.py β†’ app_canny.py RENAMED
@@ -81,3 +81,10 @@ def create_demo(process, max_images=12, default_num_images=3):
81
  outputs=result,
82
  api_name='canny')
83
  return demo
 
 
 
 
 
 
 
 
81
  outputs=result,
82
  api_name='canny')
83
  return demo
84
+
85
+
86
+ if __name__ == '__main__':
87
+ from model import Model
88
+ model = Model()
89
+ demo = create_demo(model.process_canny)
90
+ demo.queue().launch()
gradio_depth2image.py β†’ app_depth.py RENAMED
@@ -73,3 +73,10 @@ def create_demo(process, max_images=12, default_num_images=3):
73
  outputs=result,
74
  api_name='depth')
75
  return demo
 
 
 
 
 
 
 
 
73
  outputs=result,
74
  api_name='depth')
75
  return demo
76
+
77
+
78
+ if __name__ == '__main__':
79
+ from model import Model
80
+ model = Model()
81
+ demo = create_demo(model.process_depth)
82
+ demo.queue().launch()
gradio_fake_scribble2image.py β†’ app_fake_scribble.py RENAMED
@@ -73,3 +73,10 @@ def create_demo(process, max_images=12, default_num_images=3):
73
  outputs=result,
74
  api_name='fake_scribble')
75
  return demo
 
 
 
 
 
 
 
 
73
  outputs=result,
74
  api_name='fake_scribble')
75
  return demo
76
+
77
+
78
+ if __name__ == '__main__':
79
+ from model import Model
80
+ model = Model()
81
+ demo = create_demo(model.process_fake_scribble)
82
+ demo.queue().launch()
gradio_hed2image.py β†’ app_hed.py RENAMED
@@ -73,3 +73,10 @@ def create_demo(process, max_images=12, default_num_images=3):
73
  outputs=result,
74
  api_name='hed')
75
  return demo
 
 
 
 
 
 
 
 
73
  outputs=result,
74
  api_name='hed')
75
  return demo
76
+
77
+
78
+ if __name__ == '__main__':
79
+ from model import Model
80
+ model = Model()
81
+ demo = create_demo(model.process_hed)
82
+ demo.queue().launch()
gradio_hough2image.py β†’ app_hough.py RENAMED
@@ -87,3 +87,10 @@ def create_demo(process, max_images=12, default_num_images=3):
87
  outputs=result,
88
  api_name='hough')
89
  return demo
 
 
 
 
 
 
 
 
87
  outputs=result,
88
  api_name='hough')
89
  return demo
90
+
91
+
92
+ if __name__ == '__main__':
93
+ from model import Model
94
+ model = Model()
95
+ demo = create_demo(model.process_hough)
96
+ demo.queue().launch()
gradio_normal2image.py β†’ app_normal.py RENAMED
@@ -80,3 +80,10 @@ def create_demo(process, max_images=12, default_num_images=3):
80
  outputs=result,
81
  api_name='normal')
82
  return demo
 
 
 
 
 
 
 
 
80
  outputs=result,
81
  api_name='normal')
82
  return demo
83
+
84
+
85
+ if __name__ == '__main__':
86
+ from model import Model
87
+ model = Model()
88
+ demo = create_demo(model.process_normal)
89
+ demo.queue().launch()
gradio_pose2image.py β†’ app_pose.py RENAMED
@@ -73,3 +73,10 @@ def create_demo(process, max_images=12, default_num_images=3):
73
  outputs=result,
74
  api_name='pose')
75
  return demo
 
 
 
 
 
 
 
 
73
  outputs=result,
74
  api_name='pose')
75
  return demo
76
+
77
+
78
+ if __name__ == '__main__':
79
+ from model import Model
80
+ model = Model()
81
+ demo = create_demo(model.process_pose)
82
+ demo.queue().launch()
gradio_scribble2image.py β†’ app_scribble.py RENAMED
@@ -67,3 +67,10 @@ def create_demo(process, max_images=12, default_num_images=3):
67
  outputs=result,
68
  api_name='scribble')
69
  return demo
 
 
 
 
 
 
 
 
67
  outputs=result,
68
  api_name='scribble')
69
  return demo
70
+
71
+
72
+ if __name__ == '__main__':
73
+ from model import Model
74
+ model = Model()
75
+ demo = create_demo(model.process_scribble)
76
+ demo.queue().launch()
gradio_scribble2image_interactive.py β†’ app_scribble_interactive.py RENAMED
@@ -93,3 +93,10 @@ def create_demo(process, max_images=12, default_num_images=3):
93
  ]
94
  run_button.click(fn=process, inputs=inputs, outputs=result)
95
  return demo
 
 
 
 
 
 
 
 
93
  ]
94
  run_button.click(fn=process, inputs=inputs, outputs=result)
95
  return demo
96
+
97
+
98
+ if __name__ == '__main__':
99
+ from model import Model
100
+ model = Model()
101
+ demo = create_demo(model.process_scribble_interactive)
102
+ demo.queue().launch()
gradio_seg2image.py β†’ app_seg.py RENAMED
@@ -74,3 +74,10 @@ def create_demo(process, max_images=12, default_num_images=3):
74
  outputs=result,
75
  api_name='seg')
76
  return demo
 
 
 
 
 
 
 
 
74
  outputs=result,
75
  api_name='seg')
76
  return demo
77
+
78
+
79
+ if __name__ == '__main__':
80
+ from model import Model
81
+ model = Model()
82
+ demo = create_demo(model.process_seg)
83
+ demo.queue().launch()