# Differences between different kind of annotations with the same model

**URL:** https://discuss.roboflow.com/t/differences-between-different-kind-of-annotations-with-the-same-model/2552
**Category:** 🤝  Community Help
**Tags:** bugs
**Created:** [July 2, 2023, 5:01am UTC](https://discuss.roboflow.com/t/differences-between-different-kind-of-annotations-with-the-same-model/2552 "2023-07-02T05:01:16Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jvprimakipr](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/jvprimakipr/32/2249_2.png) [@jvprimakipr](https://discuss.roboflow.com/u/jvprimakipr)
#### Post date: [July 2, 2023, 5:01am UTC](https://discuss.roboflow.com/t/differences-between-different-kind-of-annotations-with-the-same-model/2552/1 "2023-07-02T05:01:16Z")

</div>

Why are there differences between the annotations generated in roboflow’s label assist and those generated in a python script? Of course, both are using the same model, with the same parameters:

confidence = 60%  
overlap = 30%

My project is about Object Detection.

We can see the difference in the image below:

 ![Captura de tela 2023-07-02 014428](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/2X/8/8491e211c2672c855a955f48f52497b260f187fd.jpeg)

On the left is the annotation generated by the script, with 14 bounding box, some of them overlapping.  
On the right is the annotation generated by the label assist, with only 6 bounding box and none of them are overlapping.

I just would like to get the result of the right using the script.

My code is shown below:

```auto
# Initialize the Roboflow object with your API key
rf = Roboflow(api_key="MY_API_KEY")

# Retrieve your current workspace and project name
workspace = rf.workspace()

# Specify the project for upload
project = workspace.project("tdm")

# Import the model from the project
n_version = 12
model = project.version(n_version).model
model.confidence = 60
model.overlap = 30

character_id = 0
n_pages = len(os.listdir(cbs[character_id]['path']))

for (i, file_name) in enumerate(os.listdir(cbs[character_id]['path'])):
        tags = []
        if i == 0:
            tags.append('cover')
        elif i == n_pages-1:
            tags.append('comic_strip')
        
        image_path = cbs[character_id]['path'] + file_name
        annotation_path = cbs[character_id]['path'] + 'Annotation/' + file_name.split('.')[0] + '.json'

        json_annotation = json.dumps(model.predict(image_path).json(), indent=4)
        with open(annotation_path, "w") as outfile:
            outfile.write(json_annotation)

        project.upload(
            image_path = image_path,
            annotation_path = annotation_path,
            batch_name = cbs[character_id]['batch_name'],
            tag_names = tags,
            sequence_number = i+1,
            sequence_size = n_pages+1,
            is_prediction = True,
            #split="train",
            num_retry_uploads=2
        )

```

I really don’t understand the problem…

---

<div class="post-metadata">

### Author: ![leo](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/leo/32/2228_2.png) [@leo](https://discuss.roboflow.com/u/leo)
#### Post date: [July 3, 2023, 7:59pm UTC](https://discuss.roboflow.com/t/differences-between-different-kind-of-annotations-with-the-same-model/2552/2 "2023-07-03T19:59:08Z")

</div>

Hi @jvprimakipr

It looks like you are using the Roboflow Python SDK on an object detection model.

> [@jvprimakipr](#):
>
> ```auto
> model.confidence = 60
> model.overlap = 30
> 
> ```

Here, it looks like you are assigning the minimum confidence and overlap as properties of the model variable, but our Python package accepts these parameters in `model.predict()`.

From our docs:

```auto
model.predict("your_image.jpg", confidence=40, overlap=30)

```

To learn more, refer to [our docs here](https://docs.roboflow.com/deploy/hosted-api/object-detection) to see how to infer with the Python SDK.

I hope this resolves your issue.

---

<div class="post-metadata">

### Author: ![jvprimakipr](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/jvprimakipr/32/2249_2.png) [@jvprimakipr](https://discuss.roboflow.com/u/jvprimakipr)
#### Post date: [July 3, 2023, 9:22pm UTC](https://discuss.roboflow.com/t/differences-between-different-kind-of-annotations-with-the-same-model/2552/3 "2023-07-03T21:22:48Z")

</div>

Sorry to say this, but does not change anything in the results. I don’t understand why I have this problem using the same model in both situations.

Even if I don’t set the parameters, the result in both situations is still different, with the default value of confidence=40 and overlap=30.

I already read a lot in roboflow documentation, thinking that some text could explain this, but I didn’t find it.
