Metadata Query
How Do I Search for Specific Assets?
- Go to Dataset - This is the place to access, modify, and view your data easily.
- Select and Enter Prompt into Search Bar - Ensure that you have Metadata selected so you are searching based on Metadata Query. If Filename is selected, you will be searching just based on filename.
Congratulations, your results have been queried, filtered, and listed below!
What is Metadata Query?
Metadata Query is a in-built search engine on Nexus that allows you to better investigate your data to understand and discover nuances that can affect performance. This is useful at any stage in the computer vision pipeline, whether it acts as a tool for data discovery after annotation is complete to identifying edge cases that can impact model training and performance.
Why Use Metadata Query?
Metadata Query enables teams to effectively and efficiently enact sanity checks on their data pre and post-training. This lets teams improve production AI by moving past aggregate metrics and placing an emphasis on understanding their data in depth. Once teams understand their qualitative failure modes, they can fix them by gathering the right data to handle edge cases as well as debug poor model performance - reducing time spent sifting through data, and more time on model iteration.
How to Use Metadata Query?
Using tag names, you can filter annotated images with tags using query strings like 'boat' as well as use logic terms like 'and' and 'or' to make the query more specific, i.e. 'RBC and WBC'.
You can also use image metadata in your queries with several combinations.
List of Fields
Metadata Field | Example Usage |
---|---|
Annotation tag | RBC and WBC returns images labeled with "RBC" and "WBC" |
File size | fileSize > 1000 returns images with file sizes greater than 1000 bytes |
Image height | height > 100 returns images with pixel height greater than 100 |
Image width | width > 100 returns images with pixel height greater than 100 |
Filename | filename == "s(92).jpg" returns image with name equal to the string |
Asset group | "mygroup" in groups returns images who are part of the "mygroup" asset group |
Annotation status | `status in ["annotated", "none"] ` returns image whose annotation status is either annotated or none |
List of Operators
Operator | Example | Explanation |
---|---|---|
and | RBC and WBC | Returns all images that are labeled with "RBC" AND "WBC" |
or | RBC or WBC | Returns all images that are labeled with either "RBC" OR "WBC" |
Addition (x +y) | RBC + WBC >= 5 | Returns all images where the sum of "RBC" and "WBC" labels is more than or equal to 5 |
Subtraction (x - y) | RBC - WBC \<= 3 | Returns all images where the subtraction of "WBC" from "RBC" labels is less than or equal to 3 |
Division (x / y) | RBC / WBC = 2 | Returns all images where the division of the number of "RBC" labels over "WBC" is equal to 2 |
Modulo (x % y) | RBC % 2 | Returns all images where there are is an 'odd' number of "RBC" labels |
Power (x ^ y) | RBC ^2 \<= 16 | Returns all images where the number of labels of "RBC" raised to the power of 2 is less than or equal to 16 |
List of Comparators
Operator | Example | Explanation |
---|---|---|
Equals (x == y) | RBC == instances | Returns all images where the number of "RBC" labels is equal to the total number of labels in the image i.e "Show me all images where there are only RBC (red blood cells)" |
Does not equal (x ! = y) | RBC ! = WBC | Returns all images where the number of "RBC" labels is NOT equal to the number of "WBC" labels |
Less than ( < ) | RBC \< 3 | Returns all images where the number of "RBC" labels is less than 3 |
Less than or equal to ( <= ) | RBC - WBC \<= 3 | Returns all images where the subtraction of "WBC" from "RBC" labels is less than or equal to 3 |
More than ( > ) | RBC / WBC > 2 | Returns all images where the division of the number of "RBC" labels over "WBC" is more than 2 |
More than or equal to ( >= ) | RBC + WBC >= 3 | Returns all images where the sum of "RBC" and "WBC" labels are greater than or equal to 3 |
You can also make queries with conditional statements on the objects annotated using relational tools like <
, >
, <=
, >=
, ==
, and %
. Example strings can be RBC > 4 or WBC \< 3
or width / height \<= 1 and filesize \<= 1000000
. Additionally, you can use logical operators like and
and or
and (
and )
to string multiple conditional statements together to make for a more complex query.
These can be used not just for blindly restricting and filtering data, but also used to spot outliers using your industry or application-specific knowledge. For example, if you know that your dataset is full of bicycles with labeled wheels, wheels % 2 == 1
will indicate images in which images of a bicycle may be incomplete or poor quality images that should be checked for validity.
![An example of where the query is `RBC <= 25 and WBC%2 == 0` (Click image to enlarge)](https://files.readme.io/d065ab9-frame_generic_dark_59.png)
An example of where the query is RBC <= 25 and WBC%2 == 0
(Click image to enlarge)
Custom Asset Metadata
To make queries using your custom asset metadata not listed in the default supported fields, you will need to prepend asset.metadata
to your query. For example, to search for an image with "timestamp": "1699006498"
, simply create your query as such: asset.metadata.timestamp == 1699006498
. Do ensure that the metadata query name matches the names specified in your metadata objects upon asset upload.
Updated 10 months ago