You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by youngdjn February 1, 2023
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.
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.
The text was updated successfully, but these errors were encountered:
You are changing the "ms.photos.label". However, when using the roi.back2raw() function, the parameter passed is "ms.photos.item_label", which is a dictionary, different from "ms.photos.label"
So to change the labels correctly, you need to modify the "ms.photos.item_label", here's my practice
new_dic = {} for i in range(len(ms.photos)): new_key = "newlabel_" + str(i) new_dic[new_key] = i ms.photos.item_label = new_dic
Notes
After using roi.back2raw(),modifications will be stored in the *.psx file, which is irreversible, so please make a backup of the *.psx file.
I only modifed the "ms.photos.item_label", the "ms.photos.label", "ms.photos.label" hasn't changed. So you may need to re-read the *.psx file after saving it, or do what you did with "ms.photos.label" at the same time. But as I practice, it doesn't matter whether I do that or not.
You are changing the "ms.photos.label". However, when using the roi.back2raw() function, the parameter passed is "ms.photos.item_label", which is a dictionary, different from "ms.photos.label" So to change the labels correctly, you need to modify the "ms.photos.item_label", here's my practice
new_dic = {}for i in range(len(ms.photos)): new_key = "newlabel_" + str(i) new_dic[new_key] = ims.photos.item_label = new_dic
Notes
After using roi.back2raw(),modifications will be stored in the *.psx file, which is irreversible, so please make a backup of the *.psx file.
I only modifed the "ms.photos.item_label", the "ms.photos.label", "ms.photos.label" hasn't changed. So you may need to re-read the *.psx file after saving it, or do what you did with "ms.photos.label" at the same time. But as I practice, it doesn't matter whether I do that or not.
Discussed in #75
Originally posted by youngdjn February 1, 2023
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.
The text was updated successfully, but these errors were encountered: