File “class_inference.py”, line 233, in
main()
File “class_inference.py”, line 230, in main
test(model, args, args.image_dir, args.save_dir)
File “class_inference.py”, line 118, in test
merge_image_alpha(orig_img, ret_alpha, name, results_save_dir, fg_thre=128, boundary_color=False)
File “class_inference.py”, line 81, in merge_image_alpha
cv2.imwrite(image_merge_countor_path, cv2.merge((image, alpha)))
cv2.error: OpenCV(4.5.4-dev) /tmp/pip-req-build-5mtujfce/opencv/modules/core/src/merge.dispatch.cpp:129: error: (-215:Assertion failed) mv[i].size == mv[0].size && mv[i].depth() == depth in function ‘merge’
原因是alpha和image类型没对应,转换为同样的即可。