Spaces:
Build error
Build error
parokshsaxena commited on
Commit ยท
4191c16
1
Parent(s): fa463a7
resizing to original size as per the IDM model, moving category as variable
Browse files122 unmodified lines12312412512612712612712812913013113213313413522 unmodified lines158159160161162163164161165166167168122 unmodified lines
#WIDTH = int(4160/4) # 768#HEIGHT = int(6240/4) # 1024WIDTH = int(768*2)HEIGHT = int(1024*2)WIDTH = int(768)HEIGHT = int(1024)POSE_WIDTH = int(WIDTH/2) # int(WIDTH/2)POSE_HEIGHT = int(HEIGHT/2) #int(HEIGHT/2)
CATEGORY = "upper_body" # "lower_body"
@spaces.GPUdef start_tryon(dict,garm_img,garment_des,is_checked,is_checked_crop,denoise_steps,seed): device = "cuda"22 unmodified lines
if is_checked: # internally openpose_model is resizing human_img to resolution 384 if not passed as input keypoints = openpose_model(human_img.resize((POSE_WIDTH, POSE_HEIGHT))) model_parse, _ = parsing_model(human_img.resize((POSE_WIDTH, POSE_HEIGHT))) # internally get mask location function is resizing model_parse to 384x512 if width & height not passed mask, mask_gray = get_mask_location('hd', "upper_body", model_parse, keypoints) mask, mask_gray = get_mask_location('hd', CATEGORY, model_parse, keypoints) mask = mask.resize((WIDTH, HEIGHT)) logging.info("Mask location on model identified") else:app.py+7-3