jhj0517 commited on
Commit
902b0d6
1 Parent(s): 25dee92

add gradio share arg

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -9,6 +9,7 @@ from downloading_weights import download_models
9
 
10
  class App:
11
  def __init__(self, args):
 
12
  self.pose_alignment_infer = PoseAlignmentInference(
13
  model_dir=args.model_dir,
14
  output_dir=args.output_dir
@@ -132,7 +133,9 @@ class App:
132
 
133
  def launch(self):
134
  demo = self.musepose_demo()
135
- demo.queue().launch()
 
 
136
 
137
 
138
  if __name__ == "__main__":
@@ -140,6 +143,7 @@ if __name__ == "__main__":
140
  parser.add_argument('--model_dir', type=str, default=os.path.join("pretrained_weights"), help='Pretrained models directory for MusePose')
141
  parser.add_argument('--output_dir', type=str, default=os.path.join("outputs"), help='Output directory for the result')
142
  parser.add_argument('--disable_model_download_at_start', type=bool, default=False, nargs='?', const=True, help='Disable model download at start or not')
 
143
  args = parser.parse_args()
144
 
145
  app = App(args=args)
 
9
 
10
  class App:
11
  def __init__(self, args):
12
+ self.args = args
13
  self.pose_alignment_infer = PoseAlignmentInference(
14
  model_dir=args.model_dir,
15
  output_dir=args.output_dir
 
133
 
134
  def launch(self):
135
  demo = self.musepose_demo()
136
+ demo.queue().launch(
137
+ share=self.args.share
138
+ )
139
 
140
 
141
  if __name__ == "__main__":
 
143
  parser.add_argument('--model_dir', type=str, default=os.path.join("pretrained_weights"), help='Pretrained models directory for MusePose')
144
  parser.add_argument('--output_dir', type=str, default=os.path.join("outputs"), help='Output directory for the result')
145
  parser.add_argument('--disable_model_download_at_start', type=bool, default=False, nargs='?', const=True, help='Disable model download at start or not')
146
+ parser.add_argument('--share', type=bool, default=False, nargs='?', const=True, help='Gradio makes sharable link if it is true')
147
  args = parser.parse_args()
148
 
149
  app = App(args=args)