Replies: 1 comment 1 reply
-
Actually, the # list style
In [8]: ms.photos[0]
Out[8]: <easyidp.reconstruct.Photo at 0x7fb119126130>
# dict style
In [9]: ms.photos['100MEDIA-DJI_0003']
Out[9]: <easyidp.reconstruct.Photo at 0x7fb119126130> The In [7]: ms.photos.keys()
Out[7]: dict_keys(['100MEDIA-DJI_0003', '100MEDIA-DJI_0004', '100MEDIA-DJI_0005', '100MEDIA-DJI_0006', ... The easyidp uses the So in this case, if you really need to, you should change it carefully: for i in range(len(ms.photos)):
new_key = "newlabel" + str(i)
old_key = ms.photos[i].label.copy()
# change the photo.label
# ms.photos[i].label = new_key
# change the photos.key
ms.photos.item_label[new_key] = ms.photos.item_label.pop(old_key) Then the following ms object should return the expected labels for you. In [15]: ms.photos
Out[15]:
<easyidp.Container> with 218 items
[0] newlabel0
<easyidp.reconstruct.Photo object at 0x7fb119126130>
[1] newlabel1
<easyidp.reconstruct.Photo object at 0x7fb119126f70>
...
[216] newlabel216
<easyidp.reconstruct.Photo object at 0x7fb1087a16a0>
[217] newlabel217
<easyidp.reconstruct.Photo object at 0x7fb1087a16d0> Personally would prefer organizing the image folder / metashape camera group by meaningful name in the data preparation stage first, then using the produced name automatically, rather than changing them to be meaningful in the data analysis stage. Hope this helps you. Will support using photo.label as output index in the future release #76 |
Beta Was this translation helpful? Give feedback.
-
This is potentially a Python newbie issue -- apologies if so.
I am trying to change the labels of the photos (
Photo.label
) in my project, but this does not propagate to downstream places where I think the photo label is (should be?) used.For example using this project, if I run:
I get
'100MEDIA-DJI_0165'
Then I attempt to rename them:
and I get
'newlabel57'
.But then I run back projection
And the labels in the returned dict are the original ones:
And also when running
show_roi_on_img()
it only works when I reference the photos by their original labels, like:and it doesn't work when I run:
Can you suggest a way to fully change the labels?
The reason for this request is that I am trying to give the photos more meaningful labels so that I can more easily link the photo labels to the original photo files.
Beta Was this translation helpful? Give feedback.
All reactions