Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -301,10 +301,10 @@ def resize_and_center_crop(image, output_size=(1024, 576)):
|
|
301 |
def main(device, segment_type):
|
302 |
pipe, controller, pipe_concept = build_model_sd(args.pretrained_sdxl_model, args.openpose_checkpoint, device, prompts_tmp)
|
303 |
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
|
309 |
resolution_list = ["1440*728",
|
310 |
"1344*768",
|
@@ -324,8 +324,8 @@ def main(device, segment_type):
|
|
324 |
|
325 |
depth_estimator = DPTForDepthEstimation.from_pretrained(args.dpt_checkpoint).to("cuda")
|
326 |
feature_extractor = DPTFeatureExtractor.from_pretrained(args.dpt_checkpoint)
|
327 |
-
|
328 |
-
|
329 |
|
330 |
def remove_tips():
|
331 |
return gr.update(visible=False)
|
|
|
301 |
def main(device, segment_type):
|
302 |
pipe, controller, pipe_concept = build_model_sd(args.pretrained_sdxl_model, args.openpose_checkpoint, device, prompts_tmp)
|
303 |
|
304 |
+
if segment_type == 'GroundingDINO':
|
305 |
+
detect_model, sam = build_dino_segment_model(args.dino_checkpoint, args.sam_checkpoint)
|
306 |
+
else:
|
307 |
+
detect_model, sam = build_yolo_segment_model(args.efficientViT_checkpoint, device)
|
308 |
|
309 |
resolution_list = ["1440*728",
|
310 |
"1344*768",
|
|
|
324 |
|
325 |
depth_estimator = DPTForDepthEstimation.from_pretrained(args.dpt_checkpoint).to("cuda")
|
326 |
feature_extractor = DPTFeatureExtractor.from_pretrained(args.dpt_checkpoint)
|
327 |
+
body_model = Body(args.pose_detector_checkpoint)
|
328 |
+
openpose = OpenposeDetector(body_model)
|
329 |
|
330 |
def remove_tips():
|
331 |
return gr.update(visible=False)
|