@staticmethod<EOL><INDENT>def from_shapely(polygon_shapely, label=None):<DEDENT>
<EOL>import shapely.geometry<EOL>ia.do_assert(isinstance(polygon_shapely, shapely.geometry.Polygon))<EOL>if polygon_shapely.exterior is None or len(polygon_shapely.exterior.coords) == <NUM_LIT:0>:<EOL><INDENT>return Polygon([], label=label)<EOL><DEDENT>exterior = np.float32([[x, y] for (x, y) in polygon_shapely.exterior.coords])<EOL>return Polygon(exterior, label=label)<EOL>
Create a polygon from a Shapely polygon.

Note: This will remove any holes in the Shapely polygon.

Parameters
----------
polygon_shapely : shapely.geometry.Polygon
     The shapely polygon.

label : None or str, optional
    The label of the new polygon.

Returns
-------
imgaug.Polygon
    A polygon with the same exterior as the Shapely polygon.