Unknown syntax in code for yolov3

I came across this piece of code. Can anyone explain what the ... means?

        x = torch.sigmoid(prediction[..., 0])  # Center x
        y = torch.sigmoid(prediction[..., 1])  # Center y
        w = prediction[..., 2]  # Width
        h = prediction[..., 3]  # Height


Yolo tries to find objects in the image. It outputs predictions in the form of boxes. Each box has a coordinate x,y which determines its location. It also has a width and a height which determines the predictions size. That’s the basics. If you want to understand it deeper, have a look at this blog or google around :slight_smile: Good luck!

Edit: I also like this guys blog posts

Edit2: Shit, I misread the question. The ... means that it slices in all the dimensions that aren’t specified. In this case it’s all the dimension but the last. It’s basically doing prediction[:,:,:,:,0]

1 Like