parser.add_argument('--pyinn', action='store_true', help="Use pyinn based Cuda implementation" "for message passing.") # parser.add_argument('--compare', action='store_true') # parser.add_argument('--embed', action='store_true') # args = parser.parse_args() return parser if __name__ == '__main__': parser = get_parser() args = parser.parse_args( '--image E:/研三/kaggle竞赛/crf/ConvCRF-master/data/2007_000346_0img.png --label E:/研三/kaggle竞赛/crf/ConvCRF-master/data/2007_000346_5labels.png' .split()) # Load data image = imageio.imread(args.image) label = imageio.imread(args.label) # Produce unary by adding noise to label unary = synthetic.augment_label(label, num_classes=21) # Compute CRF inference prediction = do_crf_inference(image, args) # Plot output plot_results(image, prediction, label, args) logging.info("Thank you for trying ConvCRFs.")
help="Optionally save output as img.") parser.add_argument('--nospeed', action='store_false', help="Skip speed evaluation.") parser.add_argument('--normalize', action='store_true', help="Normalize input image before inference.") parser.add_argument('--pyinn', action='store_true', help="Use pyinn based Cuda implementation" "for message passing.") return parser if __name__ == '__main__': parser = get_parser() args = parser.parse_args() # Load data image = imageio.imread(args.image) label = imageio.imread(args.label) # Produce unary by adding noise to label unary = synthetic.augment_label(label, num_classes=21) # Compute CRF inference conv_out, full_out = do_crf_inference(image, unary, args) plot_results(image, unary, conv_out, full_out, label, args) logging.info("Thank you for trying ConvCRFs.")