movearbitrarily / multi-stream

1 stars 1 forks source link

preprocessing #2

Open 112200tyh opened 4 months ago

112200tyh commented 4 months ago

Thanks to the author for contributing. Is there any source code for the CTR-GCN model to use these two preprocessing methods?

RuijieH commented 4 months ago

Just modify the feeder_{dataset}.py in CTR-GCN to get frame-level sequence and add the corresponding field in config.yaml. For example, add these code in feeder_ntu.py and joint_frame.yaml

  1. Add code in feeder_ntu.py after line 79 (https://github.com/Uason-Chen/CTR-GCN/blob/e13d7582e281d06711eeecb380a472b278ae1663/feeders/feeder_ntu.py#L79)
    
    if self.frame:
            if(data_numpy[:,:,:,1].sum()==0):
                data_numpy[:,:,:,0] = data_numpy[:,:,:,0] - data_numpy[:, :, 1:2, 0]
            else:
                data_numpy = data_numpy - data_numpy[:, :,1:2,0:1]
            if valid_frame_num != np.sum(data_numpy.sum(0).sum(-1).sum(-1) != 0):
                print("valid_frame_num is different between s trans and frame trans---------")

2. Add frame file in joint_frame.yaml
```yaml
train_feeder_args:
  data_path: data/ntu/NTU60_CS.npz
  split: train
  debug: False
  random_choose: False
  random_shift: False
  random_move: False
  window_size: 64
  normalization: False
  random_rot: True
  p_interval: [0.5, 1]
  vel: False
  bone: False
  frame: True

test_feeder_args:
  data_path: data/ntu/NTU60_CS.npz
  split: test
  window_size: 64
  p_interval: [0.95]
  vel: False
  bone: False
  debug: False
  frame: True