Open oguz-hanoglu opened 2 years ago
If you'd like your alternate media fields to be available in a patches view, you just need to include them in the other_fields
argument of to_patches():
import fiftyone as fo
import fiftyone.zoo as foz
import fiftyone.utils.image as foui
dataset = foz.load_zoo_dataset("quickstart")
foui.transform_images(
dataset,
max_size=(-1, 64),
output_field="thumbnail_path",
output_dir="/tmp/thumbnails",
)
dataset.app_config.media_fields = ["filepath", "thumbnail_path"]
dataset.app_config.grid_media_field = "thumbnail_path"
dataset.save()
patches = dataset.to_patches("ground_truth", other_fields=["thumbnail_path"])
session = fo.launch_app(patches)
OK. I already explained this solution under "Other info / logs" parts, sorry if my point was not clear.
My main point is it would be better if the default behavior already includes it. But for the thumbnail case, this would not be meaningful.
Then my point becomes updating the media field in the app. Why would the media field show "thumbnail" if it is not available in patches view? (if only it is included in the other field, then displaying thumbnail under media field becomes useful)
But this would also be non applicable for some reason.
Then, my point becomes
the error "This image failed to load. The file may not exist, or its type (image/png) may be unsupported"
is misleading, at least for an average user, my humble opinion.
That's a fair point. We should either include all media fields by default or remove the extra media fields from the selector unless they were specifically included.
patches = dataset.to_patches("ground_truth", other_fields=["thumbnail_path"])
@brimoor Hey wanted to thank you for posting this. I was going nuts trying to figure out how to maintain the thumbnail view in patch view. I am having a really hard time with the performance of fiftyone, and this will help i hope
System information
fiftyone --version
): v0.17.2Describe the problem
When moved to patches_view, media_field buttons result in "This image failed to load. The file may not exist, or its type (image/png) may be unsupported"
Code to reproduce issue
Other info / logs
Problem disappears when
session.view = my_dataset.to_patches("det", other_fields=["t_1", "t_2"])
is used.I guess, to_patches, by default, has to consider my_dataset.app_config.media_fields list as if it is already appended to other_fields.
What areas of FiftyOne does this bug affect?
App
: FiftyOne application issueCore
: Corefiftyone
Python library issueServer
: Fiftyone server issueWillingness to contribute
The FiftyOne Community encourages bug fix contributions. Would you or another member of your organization be willing to contribute a fix for this bug to the FiftyOne codebase?