Setting up Detectron2-RPD for Windows
Prerequisites: Git and CUDA 10.2, which can be downloaded directly here and here (use the default options when installing).
Step 0) Download win-detectron2-rpd.zip and extract the files. The folder should contain these files:
Step 1) Install C++ Build Tools
Prior to starting the installation process, make sure to save any important files. In order to finish the installation, a restart is required.
Run "vs_BuildTools.exe"
After a couple of seconds, the following window should pop up:
Press Continue.
Tick the box labelled "Desktop development with C++" (IMPORTANT). Your installer should now look like so:
Press Install. (IMPORTANT) After the installation is finished, restart your PC to finalize the installation.
Step 2) Install Miniconda with Detectron 2
To install miniconda with detectron2 and the detectron2-rpd-yb repo, run "install.bat".
After the bat file finishes, the setup is complete. By default, detectron2-rpd-yb (the repo) is located in the win-detectron2-rpd folder. You can now run the model.
Step 3) Running Detectron2-RPD
Before running the model, make sure to adjust the config file (options.ini) according to your needs. The example config file included with the installation:
VOL/DICOM EXTRACTION
run_extract (True/False): Extract images from your input files (.vol/.dicom).
input_dir: The path to the directory containing your vol/dicom files.
extracted_dir: The path to the directory where extracted images will be stored.
input_format (vol/dicom): The format of the input files, vol or dicom.
INFERENCE
dataset_name: The name of your dataset.
output_dir: The path to the directory where model predictions and other data will be stored.
run_inference (True/False): Run inference on extracted images. Note: Files must already be extracted!
create_tables (True/False): Create dataset html of model outputs. Note: Inference must already be done!
VISUAL OUTPUT
create_visuals (True/False): Create visualizations of model outputs. Note: Inference must already be done and bm/bmo/im flags set!
binary_mask (True/False): Output binary mask tif files. Note: create_visuals flag must be set to True!
binary_mask_overlay (True/False): Output binary mask overlay tif files. Note: create_visuals flag must be True!
instance_mask_overlay (True/False): Output instance mask overlay tif files. Note: create_visuals flag must be True!
To run the model, run Anaconda Prompt (miniconda3), which can be found on your computer using the Windows Search function.
In the prompt window, go to detectron2-rpd-yb/detectron2-rpd-pkg/src/detectron2-rpd/ (using cd).
Once inside the folder, run the following command to run the model:
python run_program.py --config %config%
%config% = path to your config file. This is required.