kevinlin311tw / CDCL-human-part-segmentation

Repository for Paper: Cross-Domain Complementary Learning Using Pose for Multi-Person Part Segmentation (TCSVT20)
https://arxiv.org/abs/1907.05193
Other
281 stars 43 forks source link

Full part model #1

Closed ttdd11 closed 4 years ago

ttdd11 commented 4 years ago

Amazing work. When do you think the pre-trained models with all parts will be available?

kevinlin311tw commented 4 years ago

Thanks for your interest in our work! I plan to release it very soon maybe next week!

ttdd11 commented 4 years ago

Let me know, I'll give it a try! In terms of accuracy, do the models with more parts improve accuracy (foot segmentation for instance)?

glcsvg commented 4 years ago

My code for webcam

`if name == 'main':

args = parser.parse_args()
keras_weights_file = args.model

print('start processing...')
# load model
model = get_testing_model_resnet101() 
model.load_weights(keras_weights_file)
params, model_params = config_reader()

scale_list = []
for item in args.scale:
    scale_list.append(float(item))

params['scale_search'] = scale_list

# generate image with body parts

cap = cv2.VideoCapture(0)

while(True):
    # Capture frame-by-frame
    ret, frame = cap.read()
    seg = process(frame, params, model_params)
    seg_argmax = np.argmax(seg, axis=-1)
    seg_max = np.max(seg, axis=-1)
    th_mask = part_thresholding(seg_argmax)
    seg_max_thres = (seg_max > 0.1).astype(np.uint8)
    seg_argmax *= seg_max_thres
    seg_canvas = human_seg_combine_argmax_rgb(seg_argmax)
    cur_canvas = cv2.imread(args.input_folder+'/'+filename)
    canvas = cv2.addWeighted(seg_canvas, 0.6, cur_canvas, 0.4, 0)
    filename = '%s/%s.jpg'%(args.output_folder,'seg_'+filename)
    cv2.imwrite(filename, canvas) 

cap.release()
cv2.destroyAllWindows()

`and error: oriImg = cv2.imread(input_image) SystemError: returned NULL without setting an error [ WARN:0] global C:\projects\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (674) SourceReaderCB::~SourceReaderCB terminating async callback

Is there anyone who can solve the problem ?

kevinlin311tw commented 4 years ago

@ttdd11 Model+code released! Generally 7-part model performs better than 15-part model due to the domain gap issue. 15-part model is trained without any real data labels.

@glcsvg In the provided codes, We feed the image path to the function process(). You just need to slightly modify some codes in process()!