parser.add_argument("--vocab_path",default="",help="Vocabulary tree path.")
parser.add_argument("--overwrite",action="store_true",help="Do not ask for confirmation for overwriting existing images and COLMAP data.")
parser.add_argument("--mask_categories",nargs="*",type=int,default=[],help="Object categories that should be masked out from the training images. See the category-to-id mapping here: https://gist.github.com/yenchenlin/75931e87cedad3d23868a79046fc97c2")
parser.add_argument("--mask_categories",nargs="*",type=str,default=[],help="Object categories that should be masked out from the training images. See `scripts/category2id.json` for supported categories.")
args=parser.parse_args()
returnargs
...
...
@@ -391,21 +391,25 @@ if __name__ == "__main__":
withopen(OUT_PATH,"w")asoutfile:
json.dump(out,outfile,indent=2)
iflen(args.mask_categories)>1:
iflen(args.mask_categories)>0:
# Check if detectron2 is installed. If not, install it.
importimportlib.util
package_name='detectron2'
spec=importlib.util.find_spec(package_name)
ifspecisNone:
try:
importdetectron2
exceptModuleNotFoundError:
input("Detectron2 is not installed. Press enter to install it.")