|
@@ -33,7 +33,7 @@ def init_logger(args):
|
|
|
filename=args.logfile or None,
|
|
|
filemode="w")
|
|
|
|
|
|
-def plot_crops(crops, title, scatter_mid=False):
|
|
|
+def plot_crops(crops, title, scatter_mid=False, names=None):
|
|
|
|
|
|
fig = plt.figure(figsize=(16,9))
|
|
|
fig.suptitle(title, fontsize=16)
|
|
@@ -44,6 +44,8 @@ def plot_crops(crops, title, scatter_mid=False):
|
|
|
|
|
|
for j, crop in enumerate(crops, 1):
|
|
|
ax = fig.add_subplot(rows, cols, j)
|
|
|
+ if names is not None:
|
|
|
+ ax.set_title(names[j-1])
|
|
|
ax.imshow(crop)
|
|
|
ax.axis("off")
|
|
|
if scatter_mid:
|
|
@@ -115,8 +117,8 @@ def main(args):
|
|
|
ax.imshow(reveal_parts(im, xy, ratio=args.ratio))
|
|
|
|
|
|
ax.axis("off")
|
|
|
-
|
|
|
- plot_crops(part_crops, "Selected parts")
|
|
|
+ crop_names = list(data._annot.part_names.values())
|
|
|
+ plot_crops(part_crops, "Selected parts", names=crop_names)
|
|
|
|
|
|
if args.rnd:
|
|
|
plot_crops(action_crops, "Actions")
|