Import video in form of an numpy array in pytorch

How do i no the factor to divied the loss of the first target with the x,y values? Or should i normalize them first?
And why do i just get values betwen 1 and -1 as output for the cords? Or is it just because of the short training phase?

I just assume your coordinate system lies between 0 and 2000 so I normalized it with these values.
It might be a better idea to normalize your target to [0, 1].

Ok i try to normalize it but with mouse = torch.norm(mouse,p=2) it always put out a Vector of (10,1 ) ?

I would rather normalize it by dividing by the largest possible values, such that you will get the desired normalized targets between [0, 1].
Later for prediction and accuracy calculation, you could rescale it to the original interval.

Let’s assume your coordinates can be in the range [0, 2000] for x and [0, 1000] for y.
Now you could normalize it with:

coord = torch.tensor([[1567., 856.]]) # sample coordinate
coord = coord / torch.tensor([2000., 1000.]) # dividy by max values
1 Like