markup: move work files to a per-cat subdir

This commit is contained in:
2019-10-18 16:39:01 -07:00
parent 3199f6ab40
commit f819ac65b5
3 changed files with 11 additions and 9 deletions

View File

@ -76,9 +76,11 @@ def find_shapes(image_path):
return img.width, img.height, bboxes
def write_debug_image(subdir, cat_name, page_num, prods, scribbles):
def write_debug_image(subdir, name, page_num, prods, scribbles):
"""Draw an image with boxes for products, images, and shapes."""
path = os.path.join(WORKDIR, subdir, f"{cat_name}-debug-page{page_num:03d}.png")
dir = os.path.join(WORKDIR, subdir, name)
ensure_dir(dir)
path = os.path.join(dir, f"debug-page{page_num:03d}.png")
pagew = int(11*72)
pageh = int(8.5*72)