Comments (5)
I wrote a tutorial on how to implement the object detector given at my other repo from scratch over at Paperspace
The other repo contains a lot of code that offers much more options for experimentation (such as variants using float16, flags allowing you to run at isolate detection scales) as code that has been written keeping the training code to be written in future in mind.
I created this repo as a accompanying repo for the tutorial, and this code is much simpler, in order to keep the tutorial easier to follow.
from yolo_v3_tutorial_from_scratch.
So,the complete repo is https://github.com/ayooshkathuria/pytorch-yolo-v3 ?the tutorial repo is just a simple version?
from yolo_v3_tutorial_from_scratch.
I have a question about route layer
according to your article:
When layers attribute has only one value, it outputs the feature maps of the layer indexed by the value. In our example, it is -4, so the layer will output feature map from the 4th layer backwards from the Route layer.
When layers has two values, it returns the concatenated feature maps of the layers indexed by it's values. In our example it is -1, 61, and the layer will output feature maps from the previous layer (-1) and the 61st layer, concatenated along the depth dimension.
==================================
So,if the layer only has one parameter,for example,layer[0]=-4,the result is the previous of the 4th of route layer;
if the layer have 2 parameters,for example,layer[0]=-1,layer[1] =36,the result is :from the prior layer of the route layer to the 36th layer?
Is it right?
but I can not understand code in darknet.py about route layer
could you please give an example?
from yolo_v3_tutorial_from_scratch.
@gittigxuy Yep, this repo is a simpler version, and it won't be updated with training and evaluation code.
Okay, onto the route layer. The thing is that the author of YOLO config file hasn't been consistent in providing indexes of the Route layer. Negative indexing means the layer previous from the current layer, whereas positive index means the normal index counting from the first layer.
In the code above, what I've done is try to be a bit uniform and convert all the indexes to relative (negative indexing).
Here's an explanation of what each line does.
if (layers[0]) > 0:
layers[0] = layers[0] - i
You see, it means, if the first index of the layer, layer[0] is positive, then do subtract it from i
which represents the number of the current layer. Suppose if layers[0]
is 36, and current layer is 97, then the index is changed to 36 - 97 = -61
. This brings every index in a single format, and I don't have to make cases in the forward
function of darknet
object.
if len(layers) == 1:
x = outputs[i + layers[0]]
If the layers has only one value, our output is merely the feature map of the layer[0]
previous of the current layer. Again, outputs
is used to cache feature maps through the loop, and again, if i = -61 in our case, and i = 97 then our output x becomes output[36]
.
Further the code checks for if layer has two values (-1,36) types. Same thing regarding indexing followed by torch.cat
function to concatenate maps.
from yolo_v3_tutorial_from_scratch.
@gittigxuy If your issue got resolved, please be kind as to close the issue, or write an acknowledgment comment so I can 😄
from yolo_v3_tutorial_from_scratch.
Related Issues (20)
- In function prep_image
- What is loading batch?
- yolov3-tiny model image dimensions error
- how to run detect.py
- google colab
- testing object detector
- bounding boxes not correct HOT 1
- How to solve this runtime error problem? HOT 1
- darknet spp maxpool
- 'NoneType' object has no attribute 'shape' HOT 1
- cv2.imwrite doesn't output image HOT 1
- the problem of function "predict_transform" HOT 1
- Why does batch norm layer has the parameter of weight and bias? HOT 2
- Why do we reverse the final dim of the image in "prep_image"? HOT 1
- Quick question
- RuntimeError: Expected object of device type cuda but got device type cpu for argument #1 'self' in call to _thnn_conv2d_forward
- OpenCV(4.5.2) :-1: error: (-5:Bad argument) in function 'rectangle' HOT 4
- Anchors scaling for each feature map output HOT 1
- Object detection algorithms
- why no images saved in the directory named 'det' 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 yolo_v3_tutorial_from_scratch.