test_mask.py 172 B

1234567891011121314
  1. import torch
  2. from matplotlib import pyplot as plt
  3. img=torch.ones((128,128,3))
  4. mask=torch.zeros((128,128,3))
  5. mask[0:30,:,:]=1
  6. img[mask==1]=0
  7. plt.imshow(img)
  8. plt.show()