Comments (2)
These lines of code is basically building output from previous convolutions, which is part of the yolov5 Detect
module.
a = torch.tensor(anchors).float().view(nl, -1, 2).to(device)
anchor_grid = a.clone().view(nl, 1, -1, 1, 2) # shape(nl,1,na,1,2)
builds anchors, which read from yaml files (I will change it to read from *.pt weights ultralytics/yolov5#1127 (comment)).
_, _, ny_nx, _ = x[i].shape
r = imgsz[0] / imgsz[1]
nx = int(np.sqrt(ny_nx / r))
ny = int(r * nx)
gets the output shape ny (vertical) and nx (horizontal) of the i-th yolo head.
grid[i] = _make_grid(nx, ny).to(x[i].device)
creates meshgrid from the shape ny and nx.
y[..., 0:2] = (y[..., 0:2] * 2. - 0.5 + grid[i].to(x[i].device)) * stride # xy
y[..., 2:4] = (y[..., 2:4] * 2) ** 2 * anchor_grid[i] # wh
are the equations to output center coordinates xy and, width and height of the output bounding boxes.
Or you could post your question on the PRs:
ultralytics/yolov5#959
ultralytics/yolov5#1127
from onnx_tflite_yolov3.
Close this issue due to there're other suitable places for this issue (ultralytics/yolov5#959, ultralytics/yolov5#1127).
from onnx_tflite_yolov3.
Related Issues (12)
- pytorch和tensorflow的cudnn冲突? HOT 4
- The detailed commands for building TFLite GPU delegate so files HOT 3
- An Issue when loading OpenGL backend TFLite GPU delegate in Python HOT 3
- Facing problem while converting Darknet weights to ONNX model for YOLOv3 HOT 5
- 镜像环境运行报错 HOT 3
- Segmentation fault(core dump) HOT 2
- Converting unsupported operation: PyFunc HOT 1
- Use of Reshape feature HOT 4
- Error while trying to convert custom built yolov3 model to tflite model HOT 17
- Segmentation fault (core dumped) in detect.py HOT 2
- Doesn't work with anything remotely recent. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from onnx_tflite_yolov3.