Skip to content

Commit

Permalink
Converted averaged background final image back to uint8 for the plotter.
Browse files Browse the repository at this point in the history
Probably fixes alyssaq#61
  • Loading branch information
JonBoyleCoding committed Jun 25, 2021
1 parent 0d2ed9e commit 458dfdf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions facemorpher/averager.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def averager(imgpaths, dest_filename=None, width=500, height=600, background='bl
if background == 'average':
average_background = locator.average_points(images)
dest_img = blender.overlay_image(dest_img, mask, average_background)
dest_img = dest_img.astype(np.uint8)

print('Averaged {} images'.format(num_images))
plt = plotter.Plotter(plot, num_images=1, out_filename=out_filename)
Expand Down
1 change: 1 addition & 0 deletions facemorpher/morpher.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def morph(src_img, src_points, dest_img, dest_points,
if background == 'average':
average_background = blender.weighted_average(src_img, dest_img, percent)
average_face = blender.overlay_image(average_face, mask, average_background)
average_face = average_face.astype(np.uint8)

plt.plot_one(average_face)
plt.save(average_face)
Expand Down

0 comments on commit 458dfdf

Please sign in to comment.