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

pass the code to the another device #2

Open
Agito555 opened this issue Mar 23, 2021 · 0 comments
Open

pass the code to the another device #2

Agito555 opened this issue Mar 23, 2021 · 0 comments

Comments

@Agito555
Copy link
Owner

class gamma_transform(object):
def init(self,gamma_range):
self.gamma_range=gamma_range
def call(self,sample):
image, mask = sample
gamma=np.random.uniform(low=self.gamma_range[0],high=self.gamma_range[1])
image=np.array(image)
image=image/255
image=image**gamma
image=image*255
image[image>255]=255
image[image<0]=0
image=image.astype(np.uint8)
image=Image.fromarray(image)
return image, mask

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

1 participant