agrimgupta92 / sgan

Code for "Social GAN: Socially Acceptable Trajectories with Generative Adversarial Networks", Gupta et al, CVPR 2018
MIT License
813 stars 261 forks source link

how can i train the social gan on a dataset that has been created by me #75

Open ritwik18010 opened 4 years ago

saruvora commented 4 years ago

Hi, Make sure that the data is in <f, id, x, y> format with a delimiter of your choice along with train, val and test sets in respective folders. Then you're good to go. I did the same. Also, make sure that the IDs do not repeat after some time in the same dataset and have a proper frame rate of 2.5 fps.

ritwik18010 commented 4 years ago

Thanks for the help. Can I use the above procedure if I am tracking a single person in a video i.e. there is just one person ID in the entire dataset ?

theDebugger811 commented 3 years ago

Hi, For only a single pedestrian, you need to change the min_ped argument to 0 here. You can also refer to the following repo for alternate implementation.

Taraing commented 3 years ago

Hi, Make sure that the data is in <f, id, x, y> format with a delimiter of your choice along with train, val and test sets in respective folders. Then you're good to go. I did the same. Also, make sure that the IDs do not repeat after some time in the same dataset and have a proper frame rate of 2.5 fps.

Hi!I did want you said,but it always told me File "/home/wyx/sgan-master/sgan/data/trajectories.py", line 336, in init curr_seq[_idx, :, pad_front:pad_end] = curr_ped_seq # curr_seq(3220) ValueError: could not broadcast input array from shape (2,6) into shape (2,20).I consider the reason is that the change of the number of people in each frame of video,But i am not sure and can't resolve this problem.Please help me!!Thanks very much!

Taraing commented 3 years ago

Hi, For only a single pedestrian, you need to change the min_ped argument to 0 here. You can also refer to the following repo for alternate implementation.

Hi!I did want you said,but it always told me File "/home/wyx/sgan-master/sgan/data/trajectories.py", line 336, in init curr_seq[_idx, :, pad_front:pad_end] = curr_ped_seq # curr_seq(3220) ValueError: could not broadcast input array from shape (2,6) into shape (2,20).I consider the reason is that the change of the number of people in each frame of video,But i am not sure and can't resolve this problem.Please help me!!Thanks very much!

Xiejc97 commented 3 years ago

@Taraing Hello! I also meet the same question as you mentioned above. Do you deal with it and what is the cause of this error? Thanks you very much!

liusui652 commented 2 years ago

@Taraing Hi,I had the same problem, have you solved this problem? How to deal? Thank you so much! #107

lsch0lz commented 1 year ago

Did you solved this error @Taraing ?

Nadzi77 commented 1 year ago

@Taraing It is because some person is not in all 20 positions (8 observed, 12 predicted) - in your case, "(2,6)" means there are 6 positions of some person in dataset instead of 20. I had the same issue so I added these lines in trajectory.py under line curr_ped_seq = np.transpose(curr_ped_seq[:, 2:]):

if curr_ped_seq.shape != (2,20): continue

(in case you are predicting 8 positions, use (2,16) )