.split(“.”)[0]

mask_path = mask_floder + “/” + filestr + “.png”

yaml_path = dataset_root_path + “total/” + filestr + “_json/info.yaml”

print(dataset_root_path + “total/” + filestr + “_json/img.png”)

cv_img = cv2.imread(dataset_root_path + “total/” + filestr + “_json/img.png”)



self.add_image(“shapes”, image_id=i, path=img_floder + “/” + imglist.

width=cv_img.shape[1], height=cv_img.shape[0],

mask_path=mask_path, yaml_path=yaml_path)

In the code



width=cv_img.shape[1], height=cv_img.shape[0]

Automatically get the length and width of the image.



Three, image processing

The train_shapes. Ipynb code automatically gets the length and width of the image, but if you need to standardize the image to the same size, you can do it in Python. See the previous blog for the code:

———————

Author: Skipped lamb

Source: CSDN

The original:Blog.csdn.net/yql_6175402…

Copyright notice: This article is the blogger’s original article, reprint please attach the blog link!

For more free technical information: annalin1203