pytorch-yolo-v3
pytorch-yolo-v3 copied to clipboard
Simplify Darknet() class: forward pass yolo case
You mentioned in your blog we can't concatenate the first yolo layer detections to an empty tensor, but I think we actually can. This simplifies your code a bit.
Also, not 100% sure so didnt delete this, but I think you can directly send x to predict_transform(), why would you send x.data instead?
And why is there the if type(x) == int: continue? predict_transform() will never return an int right?
last, why: outputs[i] = outputs[i-1]? This might be useful for future different use cases, but in the yolo architecture you no routing layer or shortcut layer will ever need to access the yolo predictions, so no need to keep them around in outputs dict.