I haven’t looked in detail at the polygon annotations in QuPath, if you say they are GeoJSON I assume they are polygons ?
I would read the JSON file into a string, then use
geojson.loads(), iterate over the items to convert each polygon to a numpy array and finally use
skimage.draw.polygon to assign labels or
skimage.draw.polygon2mask to create masks.
I would also expect having to swap coordinates of the numpy array (not sure what order x and y are in GeoJSON) and maybe round to the nearest integer (in case the polygons are sub-pixel).
Obviously if the polygons are overlapping the labels you assign later will override the ones created earlier. But that is a general problem with label images.
Maybe you can attach a small toy example.