()
| 151 | |
| 152 | |
| 153 | def get_parser(): |
| 154 | parser = argparse.ArgumentParser() |
| 155 | |
| 156 | parser.add_argument('--gaussian-sxy', type=int, default=5, |
| 157 | help="Gaussian sxy value for CRF") |
| 158 | parser.add_argument('--bilateral-sxy', type=int, default=5, |
| 159 | help="Bilateral sxy value for CRF") |
| 160 | parser.add_argument('--bilateral-srgb', type=int, default=3, |
| 161 | help="Bilateral srgb value for CRF") |
| 162 | parser.add_argument('--epsilon', type=float, default=1e-8, |
| 163 | help="Epsilon value for CRF") |
| 164 | parser.add_argument('--m', type=int, default=2, |
| 165 | help="Number of classes in the saliency map") |
| 166 | parser.add_argument('--tau', type=float, default=1.05, |
| 167 | help="Tau value for CRF") |
| 168 | parser.add_argument('--threshold', type=float, default=0.3, |
| 169 | help="Threshold value for thresholding") |
| 170 | parser.add_argument('--input-path', type=str, default='images', |
| 171 | help="Path to the images") |
| 172 | parser.add_argument('--sal-path', type=str, default='cams', |
| 173 | help="Path to the saliency maps") |
| 174 | parser.add_argument('--output-path', type=str, default='output', |
| 175 | help="Output path of CRF postprocessed samples") |
| 176 | parser.add_argument('--postprocess', type=str, default='kmeans', choices=['crf', 'thresholding', 'kmeans'], |
| 177 | help="Postprocessing method to use (crf/thresholding/kmeans)") |
| 178 | parser.add_argument('--filter', action='store_true', |
| 179 | help="Whether to filter small clusters") |
| 180 | parser.add_argument('--min-size', type=int, default=100, |
| 181 | help="Minimum size of clusters to keep") |
| 182 | parser.add_argument('--num-contours', type=int, default=1, help="Number of contours to keep") |
| 183 | |
| 184 | return parser.parse_args() |
| 185 | if __name__ == '__main__': |
| 186 | args = get_parser() |
| 187 | print("Postprocessing started...") |
no outgoing calls
no test coverage detected