Closed dhodcz2 closed 7 months ago
name has been changed to dump_percent, added to cfg/args, and visible in documentation in inference.ipynb and inference.commandline:
def create_composite_image(self, input_image, prediction_pil, img_name):
if not self.args.dump_percent:
return
self.dump_percent += self.args.dump_percent
if self.dump_percent < 100:
return
self.dump_percent -= 100
parent = os.path.dirname(self.save_dir)
os.makedirs(parent, exist_ok=True)
We don't have automated tests yet but these checks were passed:
try:
raster = Raster(
location='Boston Common',
zoom=19,
tile_step=3,
dump_percent=10,
)
except ValueError:
...
else:
raise AssertionError('Raster should have failed')
try:
raster = Raster(
location='Boston Common',
zoom=19,
tile_step=-5,
dump_percent=10,
)
except ValueError:
...
else:
raise AssertionError('Raster should have failed')
examples/example.sh
did not create seg_results under example/segmentation
raster = Raster(
location='Boston Common',
zoom=19,
dump_percent=10,
# dump_percent=0,
)
raster.generate(2)
raster.inference()
4 images were created under segmentation/seg_results
Added commandline arg
result_percent
with default = 0 to describe the percentage of images that should be dumped:this is available as
cfg.RESULT_PERCENT
orargs.result_percent
. Removedmkdir
fromImageDumper.__init__
Asserted tile_step power of 2 in
Raster.__init__
:Inference only calls mkdir if result_percent: