nerf-object-removal
nerf-object-removal copied to clipboard
Mask annotation issue
Hi, @weders
Thank you for sharing your nice work!
I have checked your proposed dataset. I find the mask does not look enough to cover the object region.
I follow the run_real.sh
to create inpainted images.
Is this the correct way to generate a training set?
Or, your limitation?
https://github.com/nianticlabs/nerf-object-removal/blob/main/run_real.sh
import os
from torchvision.utils import save_image
import numpy as np
import cv2
import torch
def vis_object_removal_016_140():
ROOT = '/dataset/nerf-object-removal/016'
imgid = 140
img_path = os.path.join(ROOT, 'lama_images_input_real', f'{imgid}.png')
mask_path = os.path.join(ROOT, 'lama_images_input_real', f'{imgid}_mask001.png')
inpainted_img_path = os.path.join(ROOT, 'lama_images_output_real', f'{imgid}_mask001.png')
img = cv2.imread(img_path)
inpainted_img = cv2.imread(inpainted_img_path)
inpainted_img = cv2.resize(inpainted_img, (img.shape[1], img.shape[0]), interpolation=cv2.INTER_NEAREST)
mask = cv2.imread(mask_path)
mask = cv2.resize(mask, (img.shape[1], img.shape[0]), interpolation=cv2.INTER_NEAREST)
print('img:', img.shape, img.min(), img.max())
print('inpainted_img:', inpainted_img.shape, inpainted_img.min(), inpainted_img.max())
print('mask:', mask.shape, mask.min(), mask.max())
masked_img = img * (1 - mask / 255.)
vis = np.concatenate([inpainted_img, img, mask, masked_img], axis=1)
cv2.imwrite(f'tmp/vis_{imgid}.jpg', vis)
if __name__ == '__main__':
vis_object_removal_016_140()