From 66420848b2f1d444398df041827811dc7dfc9e93 Mon Sep 17 00:00:00 2001 From: "DESKTOP-UL3K6JV\\Daniq" <31.10.93@bk.ru> Date: Sun, 16 Jun 2024 16:21:27 +0500 Subject: [PATCH] To PIL --- classifiers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/classifiers.py b/classifiers.py index fce60fa..315c03c 100644 --- a/classifiers.py +++ b/classifiers.py @@ -56,12 +56,12 @@ class YOLOClassify: def classify(self, yolo_classifier_model, image_to_classify): transform = transforms.Compose( - [transforms.Resize(size=(640, 640))] + [transforms.ToPILImage()] ) - img_tensor = transform(image_to_classify).unsqueeze(0) + img_pil = transform(image_to_classify).unsqueeze(0) - result = yolo_classifier_model(img_tensor) + result = yolo_classifier_model(img_pil) class_name = None for r in result: