Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

whats the meaning of the function named add_depth_channels(image_tensor) in phalanx folds #8

Open
l475139105 opened this issue Sep 3, 2019 · 3 comments

Comments

@l475139105
Copy link

why can add_depth_channels function change GRAYSCALE images to three channels?And whats the utilize of the func in the processing of training model?
thx

@l475139105
Copy link
Author

<def add_depth_channels(image_tensor):
_, h, w = image_tensor.size()
image = torch.zeros([3, h, w])
image[0] = image_tensor
for row, const in enumerate(np.linspace(0, 1, h)):
image[1, row, :] = const
image[2] = image[0] * image[1]
return image>

@l475139105
Copy link
Author

def add_depth_channels(image_tensor): _, h, w = image_tensor.size() image = torch.zeros([3, h, w]) image[0] = image_tensor for row, const in enumerate(np.linspace(0, 1, h)): image[1, row, :] = const image[2] = image[0] * image[1] return image

@l475139105 l475139105 reopened this Sep 3, 2019
@Interesting6
Copy link

Same question.
@phalanx-hk @ybabakhin
looking forward your reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants