| import onnx | |
| input_path = "yolo11s-seg.onnx" | |
| output_path = "yolo11s-seg-cut.onnx" | |
| input_names = ["images"] | |
| output_names = ["/model.23/Concat_1_output_0", | |
| "/model.23/Concat_2_output_0", | |
| "/model.23/Concat_3_output_0", | |
| "/model.23/cv4.0/cv4.0.2/Conv_output_0", | |
| "/model.23/cv4.1/cv4.1.2/Conv_output_0", | |
| "/model.23/cv4.2/cv4.2.2/Conv_output_0", | |
| "output1"] | |
| onnx.utils.extract_model(input_path, output_path, input_names, output_names) | |