@Mohamed unfortunately, I get the same result using the API.
Here’s part of my annotations file (generated by Roboflow):
{
"predictions": [
{
"x": 325.0,
"y": 1226.0,
"width": 60.0,
"height": 322.0,
"confidence": 0.9688357710838318,
"class": "Weave Poles 12",
"points": [
{
"x": 299.8046875,
"y": 1385.7005708454208
},
{
"x": 296.30295257491224,
"y": 1376.0
},
{
"x": 297.10811289123984,
"y": 1312.0
},
{
"x": 304.0752526898058,
"y": 1296.0
},
{
"x": 306.9442384466651,
"y": 1244.8000000000002
},
{
"x": 315.9199401701312,
"y": 1222.4
},
{
"x": 316.47860157651996,
"y": 1196.8
},
{
"x": 325.50313513077737,
"y": 1164.8
},
{
"x": 326.10573726016736,
"y": 1139.2
},
{
"x": 335.09339685369946,
"y": 1113.6000000000001
},
{
"x": 337.95564157857143,
"y": 1065.6000000000001
},
{
"x": 352.5703125,
"y": 1064.862048165479
},
{
"x": 352.6696640154906,
"y": 1107.2
},
{
"x": 345.829706672372,
"y": 1120.0
},
{
"x": 343.0482209006681,
"y": 1161.6000000000001
},
{
"x": 334.0227594283532,
"y": 1184.0
},
{
"x": 333.5718575274976,
"y": 1212.8
},
{
"x": 324.43500994973067,
"y": 1241.6000000000001
},
{
"x": 323.79906792035376,
"y": 1273.6000000000001
},
{
"x": 314.8615035996504,
"y": 1305.6000000000001
},
{
"x": 314.3409620912902,
"y": 1350.4
},
{
"x": 299.8046875,
"y": 1385.7005708454208
}
],
"image_path": "input/340109653_1378244462967163_5103473470841864968_n.jpg",
"prediction_type": "InstanceSegmentationModel"
},
...
],
"image": {
"width": "1535",
"height": "2048"
}
}
I updated the auto annotate code locally to do the upload:
def annotate(
source_image_directory: str,
target_annotation_directory: str,
roboflow_api_key: str,
roboflow_project_id: str,
roboflow_project_version: int,
detection_confidence_threshold: int = 40,
detection_iou_threshold: int = 30,
) -> None:
image_source_paths = flatten_lists(
[
get_directory_content(
directory_path=source_image_directory, extension=extension
)
for extension in SUPPORTED_IMAGE_FORMATS
]
)[:1]
rf = Roboflow(api_key=roboflow_api_key)
project = rf.workspace().project(roboflow_project_id)
model = project.version(roboflow_project_version).model
for image_source_path in tqdm(image_source_paths):
annotations = model.predict(
image_path=image_source_path,
confidence=detection_confidence_threshold,
# overlap=detection_iou_threshold
).json()
source_image_file_name = os.path.basename(image_source_path)
file_name = os.path.splitext(source_image_file_name)[0]
target_json_file_name = f"{file_name}.json"
target_json_path = os.path.join(
target_annotation_directory, target_json_file_name
)
dump_to_json(target_json_path, annotations)
project.upload(
image_source_path, "output/" + target_json_file_name, image_id=file_name
)
Here’s what the image looks like in Roboflow:
You can see in the prediction payload it was generated from an instance segmentation payload and
Here’s confirmation that the project is also instance segmentation

Any help is appreciated!