parser.add_argument("--vocab_path",default="",help="Vocabulary tree path.")
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("--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")
args=parser.parse_args()
args=parser.parse_args()
returnargs
returnargs
...
@@ -389,3 +390,40 @@ if __name__ == "__main__":
...
@@ -389,3 +390,40 @@ if __name__ == "__main__":
print(f"writing {OUT_PATH}")
print(f"writing {OUT_PATH}")
withopen(OUT_PATH,"w")asoutfile:
withopen(OUT_PATH,"w")asoutfile:
json.dump(out,outfile,indent=2)
json.dump(out,outfile,indent=2)
iflen(args.mask_categories)>1:
# Check if detectron2 is installed. If not, install it.
importimportlib.util
package_name='detectron2'
spec=importlib.util.find_spec(package_name)
ifspecisNone:
input("Detectron2 is not installed. Press enter to install it.")