forked from remotebiosensing/rppg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into metaphys
# Conflicts: # dataset/dataset_loader.py # models.py
- Loading branch information
Showing
10 changed files
with
113 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import torch.nn | ||
|
||
from nets.blocks.blocks import ConvBlock2D | ||
|
||
|
||
class cnn_blocks(torch.nn.Module): | ||
def __init__(self): | ||
super(cnn_blocks, self).__init__() | ||
self.cnn_blocks = torch.nn.Sequential( | ||
ConvBlock2D(3, 16, [5, 5], [1, 1], [2, 2]), | ||
torch.nn.MaxPool2d((2, 2), stride=(2, 2)), | ||
ConvBlock2D(16, 32, [3, 3], [1, 1], [1, 1]), | ||
ConvBlock2D(32, 64, [3, 3], [1, 1], [1, 1]), | ||
torch.nn.MaxPool2d((2, 2), stride=(2, 2)), | ||
ConvBlock2D(64, 64, [3, 3], [1, 1], [1, 1]), | ||
ConvBlock2D(64, 64, [3, 3], [1, 1], [1, 1]), | ||
torch.nn.MaxPool2d((2, 2), stride=(2, 2)), | ||
ConvBlock2D(64, 64, [3, 3], [1, 1], [1, 1]), | ||
ConvBlock2D(64, 64, [3, 3], [1, 1], [1, 1]), | ||
torch.nn.MaxPool2d((2, 2), stride=(2, 2)), | ||
ConvBlock2D(64, 64, [3, 3], [1, 1], [1, 1]), | ||
ConvBlock2D(64, 64, [3, 3], [1, 1], [1, 1]), | ||
torch.nn.AdaptiveMaxPool2d(1) | ||
) | ||
|
||
def forward(self, x): | ||
[batch, channel, length, width, height] = x.shape | ||
x = x.reshape(batch * length, channel, width, height) | ||
x = self.cnn_blocks(x) | ||
return x.reshape(batch, length, -1) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters