[@portabletext/react] Unknown block type "externalImage", specify a component for it in the `components.types` prop
Welcome to our weekly FiftyOne tips and tricks blog where we recap interesting questions and answers that have recently popped up on
Slack,
GitHub, Stack Overflow, and Reddit.
Wait, what’s FiftyOne?
FiftyOne is an open source machine learning toolset that enables data science teams to improve the performance of their computer vision models by helping them curate high quality datasets, evaluate models, find mistakes, visualize embeddings, and get to production faster.
Ok, let’s dive into this week’s tips and tricks!
Making fields from duplicates_view available in exported annotations
Community Slack member Vinicius asked (and then figured out the solution on his own!):
“Is it possible to make fields such as dup_type
from the duplicates_view()
method available in exported annotations?”
Yes! There are a few ways to accomplish this. Here’s the solution that Vinicius came up with. First, move the information to detection level:
Then export the dataset with include_attributes = True
:
After importing back the dataset, move the attributes to the sample level:
Deleting label fields
Community Slack member Joy asked,
"How can I remove the label field named ‘test?’ in the screenshot below? I've tried delete_labels
and remove_dynamic_sample_field
, but neither does the trick."
You can delete the “test” field from all samples in the dataset using delete_sample_field(field_name, error_level=0)
The parameters breakdown as such:
- field_name – the field name or
embedded.field.name
- error_level (0) – the error level to use. Valid values are:
- 0 (-) – raise error if a top-level field cannot be deleted
- 1 (-) – log warning if a top-level field cannot be deleted
- 2 (-) – ignore top-level fields that cannot be deleted
Loading datasets on a headless server
Community Slack member Wes asked,
“I’m having some trouble figuring out how to load annotations on a headless server running FiftyOne. Any tips?”
To visualize your dataset in FiftyOne using a headless machine, aka remote server, check out the
remote sessions documentation.
Efficiently modifying and deleting fields in views
Community Slack member Tobias asked,
"According to the documentation when you use view = dataset.filter_labels(...)
to create a view and then save it, it should not override labels currently not in the view. On the other hand if I am selecting certain fields from a sample like this: My custom field named my_custom_field2
has been deleted from all samples in the dataset! I am not sure whether this is working as intended, as I can't use select_fields
then in this case if I want to update the samples from the view.”
This is intended behavior, as
specified in the Docs. This method does not delete samples or frames from the underlying dataset that this view excludes. If a view has excluded fields or filtered list values, this method will permanently delete this data from the dataset, unless
fields
is used to omit such fields from the save.
You can use the view.save(fields="my_custom_field1")
to save only the field you modified and leave the others untouched. However, there is a more efficient way to do this using set_values()
. This will let you avoid having to iterate over your samples in memory, and just set the new values that you want to your field directly:
Accessing samples from Amazon S3
Community Slack member ht asked,
"Using FiftyOne, can I load images directly from S3?"
The open source version of FiftyOne does not support the direct access of images stored on S3. You’ll want to upgrade to FiftyOne Teams which supports cloud-backed media, multiple users, and role-based security. Learn more about FiftyOne Teams on
the website and
Docs.Join the FiftyOne community!
Join the thousands of engineers and data scientists already using FiftyOne to solve some of the most challenging problems in computer vision today!