# Import labelstudio segmentation from a different machine

**URL:** <https://community.labelstud.io/t/import-labelstudio-segmentation-from-a-different-machine/228>\
**Category:** Label Studio Support\
**Created:** [June 3, 2024, 5:07pm UTC](https://community.labelstud.io/t/import-labelstudio-segmentation-from-a-different-machine/228 "2024-06-03T17:07:52Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![lmsasu](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@lmsasu](https://community.labelstud.io/u/lmsasu)\
**Post date:** [June 3, 2024, 7:34pm UTC](https://community.labelstud.io/t/import-labelstudio-segmentation-from-a-different-machine/228/25 "2024-06-03T19:34:42Z")

</div>

If I click on a data link - the broken Data + images in the last 2 line in picture above I get the error:  
 ![image](https://canada1.discourse-cdn.com/flex035/uploads/labelstudio/original/1X/78b976cac93f61888c261a275257960d0292de37.png)  
How can I have bots images and annotations?

---

<div class="post-metadata">

**Author:** ![sajarin](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.labelstud.io/sajarin/32/56_2.png) [@sajarin](https://community.labelstud.io/u/sajarin)\
**Post date:** [June 3, 2024, 8:20pm UTC](https://community.labelstud.io/t/import-labelstudio-segmentation-from-a-different-machine/228/26 "2024-06-03T20:20:45Z")

</div>

What is the error you get when you try to import and “Treat every bucket object as a source file” is **not** selected?

I believe that because this option is selected, it is why the annotations and images are not being formed as one task

---

<div class="post-metadata">

**Author:** ![lmsasu](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@lmsasu](https://community.labelstud.io/u/lmsasu)\
**Post date:** [June 3, 2024, 8:23pm UTC](https://community.labelstud.io/t/import-labelstudio-segmentation-from-a-different-machine/228/27 "2024-06-03T20:23:36Z")

</div>

I get “status: Failed”

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/labelstudio/original/1X/c9f34dc01efa6f83b2028e8c7929a462e4b864db.png)  
If I activate it, it shows: completed:  
 ![image](https://canada1.discourse-cdn.com/flex035/uploads/labelstudio/original/1X/8d7652e5b9f0a677a7af7b48450a26bbb9d1082d.png)

---

<div class="post-metadata">

**Author:** ![lmsasu](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@lmsasu](https://community.labelstud.io/u/lmsasu)\
**Post date:** [June 4, 2024, 4:26am UTC](https://community.labelstud.io/t/import-labelstudio-segmentation-from-a-different-machine/228/28 "2024-06-04T04:26:34Z")

</div>

It makes sense, but when I export the json file contains:

```auto
"file_upload": "bc5b3ad0-7e0dcaed-Ar1_Dd_d5.JPG",
		"drafts": [],
		"predictions": [],
		"data": {
			"image": "/data/upload/22/bc5b3ad0-7e0dcaed-Ar1_Dd_d5.JPG"
		},

```

although the files are stored into a windows directory (d:\data.…) and the file names are just `Ar1_Dd_d5.JPG`, not the two random-looking ids with dashes prepended: `bc5b3ad0-7e0dcaed-Ar1_Dd_d5.JPG`.  
How do I enforce the exported LS JSON file to contain the correct directory path?

---

<div class="post-metadata">

**Author:** ![sajarin](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.labelstud.io/sajarin/32/56_2.png) [@sajarin](https://community.labelstud.io/u/sajarin)\
**Post date:** [June 4, 2024, 4:46pm UTC](https://community.labelstud.io/t/import-labelstudio-segmentation-from-a-different-machine/228/29 "2024-06-04T16:46:58Z")

</div>

When you do not select “Treat every bucket object as a source file” and get a “status: Failed” error, it typically means that Label Studio is not able to correctly interpret the files in the storage. This option should be unchecked to avoid creating tasks for each image automatically, but you need to ensure that the paths and configurations are correct.

When you import images, Label Studio generates unique IDs for each file to avoid conflicts. This is why you see filenames like `bc5b3ad0-7e0dcaed-Ar1_Dd_d5.JPG` . To ensure that the exported JSON file contains the correct directory path, you need to modify the paths in the JSON file to match the local storage paths.

1. **Export JSON File** :
  - Export the JSON file from your project.

2. **Modify JSON File** :
  - Update the paths in the JSON file to match the local storage paths. For example:

```auto
  
     {
       "data": {
         "image": "/data/local-files/?d=path/to/your/image1.jpg"
       },
       "annotations": [
         {
           "result": [
             {
               "id": "region1",
               "type": "polygonlabels",
               "value": {
                 "points": [[10, 10], [20, 20], [30, 10]],
                 "polygonlabels": ["Label1"]
               },
               "to_name": "image",
               "from_name": "label",
               "image_rotation": 0,
               "original_width": 4000,
               "original_height": 3000
             }
           ]
         }
       ]
     }

```

[Previous page](https://community.labelstud.io/t/import-labelstudio-segmentation-from-a-different-machine/228.md?page=1)
