From 7a6bba7a259458209d8ab72a51702fcd1627696c Mon Sep 17 00:00:00 2001 From: oleg Date: Fri, 26 Feb 2021 15:07:40 -0800 Subject: [PATCH] Update yolo.py (#2120) * Avoid mutable state in Detect * LoadImages() pathlib update (#2140) * Unique *.cache filenames fix (#2134) * fix #2121 * Update test.py * Update train.py * Update autoanchor.py * Update datasets.py * Update log_dataset.py * Update datasets.py Co-authored-by: Glenn Jocher * Update train.py test batch_size (#2148) * Update train.py * Update loss.py * Update train.py (#2149) * Linear LR scheduler option (#2150) * Linear LR scheduler option * Update train.py * Update data-autodownload background tasks (#2154) * Update get_coco.sh * Update get_voc.sh * Update detect.py (#2167) Without this cv2.imshow opens a window but nothing is visible * Update requirements.txt (#2173) * Update utils/datasets.py to support .webp files (#2174) Simply added 'webp' as an image format to the img_formats array so that webp image files can be used as training data. * Changed socket port and added timeout (#2176) * PyTorch Hub results.save('path/to/dir') (#2179) * YOLOv5 Segmentation Dataloader Updates (#2188) * Update C3 module * Update C3 module * Update C3 module * Update C3 module * update * update * update * update * update * update * update * update * update * updates * updates * updates * updates * updates * updates * updates * updates * updates * updates * update * update * update * update * updates * updates * updates * updates * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update datasets * update * update * update * update attempt_downlaod() * merge * merge * update * update * update * update * update * update * update * update * update * update * parameterize eps * comments * gs-multiple * update * max_nms implemented * Create one_cycle() function * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * GitHub API rate limit fix * update * ComputeLoss * ComputeLoss * ComputeLoss * ComputeLoss * ComputeLoss * ComputeLoss * ComputeLoss * ComputeLoss * ComputeLoss * ComputeLoss * ComputeLoss * astuple * epochs * update * update * ComputeLoss() * update * update * update * update * update * update * update * update * update * update * update * merge * merge * merge * merge * update * update * update * update * commit=tag == tags[-1] * Update cudnn.benchmark * update * update * update * updates * updates * updates * updates * updates * updates * updates * update * update * update * update * update * mosaic9 * update * update * update * update * update * update * institute cache versioning * only display on existing cache * reverse cache exists booleans * Created using Colaboratory * YOLOv5 PyTorch Hub results.save() method retains filenames (#2194) * save results with name * debug * save original imgs names * Update common.py Co-authored-by: Glenn Jocher * TTA augument boxes one pixel shifted in de-flip ud and lr (#2219) * TTA augument boxes one pixel shifted in de-flip ud and lr * PEP8 reformat Co-authored-by: Jaap van de Loosdrecht Co-authored-by: Glenn Jocher * LoadStreams() frame loss bug fix (#2222) * Update yolo.py channel array (#2223) * Add check_imshow() (#2231) * Add check_imshow() * Update general.py * Update general.py * Update CI badge (#2230) * Add isdocker() (#2232) * Add isdocker() * Update general.py * Update general.py * YOLOv5 Hub URL inference bug fix (#2250) * Update common.py * Update common.py * Update common.py * Improved hubconf.py CI tests (#2251) * Unified hub and detect.py box and labels plotting (#2243) * reset head * Update inference default to multi_label=False (#2252) * Update inference default to multi_label=False * bug fix * Update plots.py * Update plots.py * Robust objectness loss balancing (#2256) * Created using Colaboratory * Update minimum stride to 32 (#2266) * Dynamic ONNX engine generation (#2208) * add: dynamic onnx export * delete: test onnx inference * fix dynamic output axis * Code reduction * fix: dynamic output axes, dynamic input naming * Remove fixed axes Co-authored-by: Shivam Swanrkar Co-authored-by: Glenn Jocher * Update greetings.yml for auto-rebase on PR (#2272) * Update Dockerfile with apt install zip (#2274) * FLOPS min stride 32 (#2276) Signed-off-by: xiaowo1996 <429740343@qq.com> * Update README.md * Amazon AWS EC2 startup and re-startup scripts (#2185) * Amazon AWS EC2 startup and re-startup scripts * Create resume.py * cleanup * Amazon AWS EC2 startup and re-startup scripts (#2282) * Update train.py (#2290) * Update train.py * Update train.py * Update train.py * Update train.py * Create train.py * Improved model+EMA checkpointing (#2292) * Enhanced model+EMA checkpointing * update * bug fix * bug fix 2 * always save optimizer * ema half * remove model.float() * model half * carry ema/model in fp32 * rm model.float() * both to float always * cleanup * cleanup * Improved model+EMA checkpointing 2 (#2295) * Fix labels being missed when image extension appears twice in filename (#2300) * W&B entity support (#2298) * W&B entity support * shorten wandb_entity to entity Co-authored-by: Jan Hajek Co-authored-by: Glenn Jocher * Avoid mutable state in Detect * Update yolo and remove .to(device) Co-authored-by: Oleg Boiko Co-authored-by: Glenn Jocher Co-authored-by: train255 Co-authored-by: ab-101 <56578530+ab-101@users.noreply.github.com> Co-authored-by: Transigent Co-authored-by: NanoCode012 Co-authored-by: Daniel Khromov Co-authored-by: VdLMV Co-authored-by: Jaap van de Loosdrecht Co-authored-by: Yann Defretin Co-authored-by: Aditya Lohia <64709773+aditya-dl@users.noreply.github.com> Co-authored-by: Shivam Swanrkar Co-authored-by: xiaowo1996 <429740343@qq.com> Co-authored-by: Iden Craven Co-authored-by: Jan Hajek Co-authored-by: Jan Hajek --- models/yolo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/yolo.py b/models/yolo.py index 41817098ccbc..85043f2b0205 100644 --- a/models/yolo.py +++ b/models/yolo.py @@ -49,7 +49,7 @@ def forward(self, x): self.grid[i] = self._make_grid(nx, ny).to(x[i].device) y = x[i].sigmoid() - y[..., 0:2] = (y[..., 0:2] * 2. - 0.5 + self.grid[i].to(x[i].device)) * self.stride[i] # xy + y[..., 0:2] = (y[..., 0:2] * 2. - 0.5 + self.grid[i]) * self.stride[i] # xy y[..., 2:4] = (y[..., 2:4] * 2) ** 2 * self.anchor_grid[i] # wh z.append(y.view(bs, -1, self.no))