Closed anutkk closed 3 months ago
Speed up legacy polygon extraction using light software optimizations:
np.asarray
np.array
PIL.ImageDraw.Draw
skimage.draw.polygon
skimage.transform.PiecewiseAffineTransform
PiecewiseAffineTransform
I tested this segmentation on the BiblIA Italian subset (3748 lines). Results:
The speedup is more pronounced for straight baselines (closer to 4x).
The difference in accuracy is only 0.04%.
Cancelling due to typo
Speed up legacy polygon extraction using light software optimizations:
np.asarray
instead ofnp.array
to convert PIL image to Numpy arrayPIL.ImageDraw.Draw
instead ofskimage.draw.polygon
to create the polygon maskskimage.transform.PiecewiseAffineTransform
instead of vanillaPiecewiseAffineTransform
I tested this segmentation on the BiblIA Italian subset (3748 lines). Results:
The speedup is more pronounced for straight baselines (closer to 4x).
The difference in accuracy is only 0.04%.