(self, image_path)
| 942 | fout.write("%s\n" % "\t".join(hierarchy)) |
| 943 | |
| 944 | def image_feature_data(self, image_path): |
| 945 | """""" |
| 946 | import torchvision |
| 947 | from torchvision import transforms |
| 948 | |
| 949 | augmentation = transforms.Compose([ |
| 950 | transforms.Resize(256), |
| 951 | transforms.CenterCrop(224), |
| 952 | transforms.ToTensor(), |
| 953 | transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]) |
| 954 | ]) |
| 955 | dataset = torchvision.datasets.ImageFolder(image_path, augmentation) |
| 956 | features = super(self, ImageNet).image_feature_data(dataset) |
| 957 | |
| 958 | return features |
| 959 | |
| 960 | def train_image_preprocess(self, image_path, save_file): |
| 961 | tar_files = glob.glob(os.path.join(image_path, "*.tar")) |
no test coverage detected