From 294a690894a2be184681e8b45c3c2daab7791ef4 Mon Sep 17 00:00:00 2001 From: Yonghye Kwon Date: Sat, 15 May 2021 22:09:09 +0900 Subject: [PATCH 1/3] rename class autoShape -> AutoShape follow other class naming convention --- models/common.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/models/common.py b/models/common.py index 9764d4c3a6c0..689aa0f3ed7c 100644 --- a/models/common.py +++ b/models/common.py @@ -223,18 +223,18 @@ def forward(self, x): return non_max_suppression(x[0], conf_thres=self.conf, iou_thres=self.iou, classes=self.classes) -class autoShape(nn.Module): +class AutoShape(nn.Module): # input-robust model wrapper for passing cv2/np/PIL/torch inputs. Includes preprocessing, inference and NMS conf = 0.25 # NMS confidence threshold iou = 0.45 # NMS IoU threshold classes = None # (optional list) filter by class def __init__(self, model): - super(autoShape, self).__init__() + super(AutoShape, self).__init__() self.model = model.eval() def autoshape(self): - print('autoShape already enabled, skipping... ') # model already converted to model.autoshape() + print('AutoShape already enabled, skipping... ') # model already converted to model.autoshape() return self @torch.no_grad() From 2f4371b47aa93cc67dee805d83a180742b709f64 Mon Sep 17 00:00:00 2001 From: Yonghye Kwon Date: Sat, 15 May 2021 22:12:17 +0900 Subject: [PATCH 2/3] rename class autoShape -> AutoShape follow other classes' naming convention --- models/yolo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/yolo.py b/models/yolo.py index 314fd806f5e7..5bbfb8d5d2a9 100644 --- a/models/yolo.py +++ b/models/yolo.py @@ -217,7 +217,7 @@ def nms(self, mode=True): # add or remove NMS module def autoshape(self): # add autoShape module logger.info('Adding autoShape... ') - m = autoShape(self) # wrap model + m = AutoShape(self) # wrap model copy_attr(m, self, include=('yaml', 'nc', 'hyp', 'names', 'stride'), exclude=()) # copy attributes return m From 70ee09280c4a321e2fe51381910eed8678352fd3 Mon Sep 17 00:00:00 2001 From: Yonghye Kwon Date: Sun, 16 May 2021 22:38:32 +0900 Subject: [PATCH 3/3] rename class autoShape -> AutoShape --- models/yolo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/yolo.py b/models/yolo.py index 5bbfb8d5d2a9..06b80032d3d3 100644 --- a/models/yolo.py +++ b/models/yolo.py @@ -215,8 +215,8 @@ def nms(self, mode=True): # add or remove NMS module self.model = self.model[:-1] # remove return self - def autoshape(self): # add autoShape module - logger.info('Adding autoShape... ') + def autoshape(self): # add AutoShape module + logger.info('Adding AutoShape... ') m = AutoShape(self) # wrap model copy_attr(m, self, include=('yaml', 'nc', 'hyp', 'names', 'stride'), exclude=()) # copy attributes return m