sgan icon indicating copy to clipboard operation
sgan copied to clipboard

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

Open ritwik18010 opened this issue 5 years ago • 9 comments

ritwik18010 avatar Dec 11 '19 23:12 ritwik18010

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.

saruvora avatar Dec 12 '19 12:12 saruvora

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 ?

ritwik18010 avatar Dec 12 '19 18:12 ritwik18010

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.

theDebugger811 avatar Feb 17 '21 13:02 theDebugger811

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 avatar Apr 06 '21 12:04 Taraing

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!

Taraing avatar Apr 06 '21 12:04 Taraing

@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!

Xiejc97 avatar Apr 29 '21 09:04 Xiejc97

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

liusui652 avatar Jan 15 '22 06:01 liusui652

Did you solved this error @Taraing ?

lsch0lz avatar Dec 25 '22 15:12 lsch0lz

@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) )

Nadzi77 avatar Apr 20 '23 17:04 Nadzi77