Skip to content

Commit

Permalink
Merge pull request #2 from JinkaiZheng/main
Browse files Browse the repository at this point in the history
modify grew info
  • Loading branch information
JinkaiZheng committed Mar 26, 2022
2 parents dc4ce35 + 5590d83 commit 795d4c0
Show file tree
Hide file tree
Showing 13 changed files with 150 additions and 15 deletions.
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/Gait3D-Benchmark.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 64 additions & 0 deletions .idea/deployment.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/gaitset_64pixel_GREW_office_split.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
data_cfg:
dataset_name: GREW-office-64pixel
dataset_root: GREW-office-64-44-pkl
dataset_root: GREW-64-44-pkl
dataset_partition: ./misc/partitions/GREW_office_split.json
num_workers: 1
remove_no_gallery: false
Expand Down
2 changes: 1 addition & 1 deletion config/gaitset_64pixel_GREW_our_split.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
data_cfg:
dataset_name: GREW-our-64pixel
dataset_root: GREW-our-64-44-pkl
dataset_root: GREW-64-44-pkl/train
dataset_partition: ./misc/partitions/GREW_our_split.json
num_workers: 1
remove_no_gallery: false
Expand Down
4 changes: 2 additions & 2 deletions lib/modeling/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ def get_loader(self, data_cfg, train=True):
if data_cfg['dataset_root']['smpl_root'] is not None:
dataset = DataSet_SMPLGait(data_cfg, train)
except:
if "GREW-office" in data_cfg['dataset_root']:
if "GREW-office" in data_cfg['dataset_name']:
dataset = DataSet_GREW_office(data_cfg, train)
elif "GREW-our" in data_cfg['dataset_root']:
elif "GREW-our" in data_cfg['dataset_name']:
dataset = DataSet_GREW_our(data_cfg, train)
else:
dataset = DataSet(data_cfg, train)
Expand Down
14 changes: 6 additions & 8 deletions lib/modeling/models/smplgait.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,21 @@ def build_network(self, model_cfg):
self.bn3 = nn.BatchNorm1d(256)
self.dropout2 = nn.Dropout(p=0.2)
self.dropout3 = nn.Dropout(p=0.2)
# self.relu = nn.ReLU()

def forward(self, inputs):
ipts, labs, _, _, seqL = inputs

sils = ipts[0][0] # [n, s, h, w]
smpls = ipts[1][0] # [n, s, h, w]
smpls = ipts[1][0] # [n, s, d]

# extract SMPL features
n, s, d = smpls.size()
sps = smpls.view(-1, d)
del smpls

sps = F.relu(self.bn1(self.fc1(sps)))
sps = F.relu(self.bn2(self.dropout2(self.fc2(sps)))) # (B, 256) or (n, c)
sps = F.relu(self.bn3(self.dropout3(self.fc3(sps)))) # (B, 256) or (n, c)
sps = F.relu(self.bn2(self.dropout2(self.fc2(sps)))) # (B, 256)
sps = F.relu(self.bn3(self.dropout3(self.fc3(sps)))) # (B, 256)
sps = sps.reshape(n*s, 16, 16)
iden = Variable(torch.eye(16)).unsqueeze(0).repeat(n*s, 1, 1) # [n*s, 16, 16]
if sps.is_cuda:
Expand Down Expand Up @@ -126,22 +125,21 @@ def build_network(self, model_cfg):
self.bn3 = nn.BatchNorm1d(1024)
self.dropout2 = nn.Dropout(p=0.2)
self.dropout3 = nn.Dropout(p=0.2)
# self.relu = nn.ReLU()

def forward(self, inputs):
ipts, labs, _, _, seqL = inputs

sils = ipts[0][0] # [n, s, h, w]
smpls = ipts[1][0] # [n, s, d, np]
smpls = ipts[1][0] # [n, s, d]

# extract SMPL features
n, s, d = smpls.size()
sps = smpls.view(-1, d)
del smpls

sps = F.relu(self.bn1(self.fc1(sps)))
sps = F.relu(self.bn2(self.dropout2(self.fc2(sps)))) # (B, 256) or (n, c)
sps = F.relu(self.bn3(self.dropout3(self.fc3(sps)))) # (B, 1024) or (n, c)
sps = F.relu(self.bn2(self.dropout2(self.fc2(sps)))) # (B, 256)
sps = F.relu(self.bn3(self.dropout3(self.fc3(sps)))) # (B, 1024)
sps = sps.reshape(n * s, 32, 32)
iden = Variable(torch.eye(32)).unsqueeze(0).repeat(n * s, 1, 1) # [n*s, 32, 32]
if sps.is_cuda:
Expand Down
6 changes: 3 additions & 3 deletions misc/run_pretreatment_grew.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# pretreat train set
python misc/pretreatment_grew.py --input_path "/export/home/data/Gait/GREW/GREW" --output_path "/export/home/data/Gait/GREW/GREW-pkl" --img_h 64 --img_w 44 --subset "train"
python misc/pretreatment_grew.py --input_path "/path/to/GREW/train" --output_path "GREW-64-44-pkl/train" --img_h 64 --img_w 44 --subset "train"
# pretreat test-gallery set
python misc/pretreatment_grew.py --input_path "/export/home/data/Gait/GREW/GREW" --output_path "/export/home/data/Gait/GREW/GREW-pkl" --img_h 64 --img_w 44 --subset "test/gallery"
python misc/pretreatment_grew.py --input_path "/path/to/GREW/test/gallery" --output_path "GREW-64-44-pkl/test/gallery" --img_h 64 --img_w 44 --subset "test/gallery"
# pretreat test-probe set
python misc/pretreatment_grew_probe.py --input_path "/export/home/data/Gait/GREW/GREW" --output_path "/export/home/data/Gait/GREW/GREW-pkl" --img_h 64 --img_w 44
python misc/pretreatment_grew_probe.py --input_path "/path/to/GREW/test/probe" --output_path "GREW-64-44-pkl/test/probe" --img_h 64 --img_w 44

0 comments on commit 795d4c0

Please sign in to comment.