pytorch-yolo-v3 icon indicating copy to clipboard operation
pytorch-yolo-v3 copied to clipboard

Simplify Darknet() class: forward pass yolo case

Open Anner-deJong opened this issue 7 years ago • 0 comments

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.

Anner-deJong avatar Oct 02 '18 06:10 Anner-deJong