Hello,
Here’s what I get 3 in the colab notebook:
---------------------------------------------------------------------------

TypeError                                 Traceback (most recent call last)

<ipython-input-27-ac798acc8333> in <module>()
      2                                                                   category_info,
      3                                                                   binary_mask,
----> 4                                                                   image.size, tolerance=2)

2 frames

/usr/local/lib/python3.6/dist-packages/PIL/Image.py in resize(self, size, resample, box)
   1866             )
   1867 
-> 1868         size = tuple(size)
   1869 
   1870         if box is None:

TypeError: 'int' object is not iterable

By the way, I also tried imantics, but without example, it’s not that easy:
import imantics
imantics.Mask.polygons(mask1)

fails yielding:
---------------------------------------------------------------------------

AttributeError                            Traceback (most recent call last)

<ipython-input-28-b97153601dd2> in <module>()
----> 1 imantics.Mask.polygons(mask1)

/usr/local/lib/python3.6/dist-packages/imantics/annotation.py in polygons(self)
    798         :rtype: :class:`Polygons`
    799         """
--> 800         if not self._c_polygons:
    801 
    802             # Generate polygons from mask

AttributeError: 'numpy.ndarray' object has no attribute '_c_polygons'