FindFrame
Find frames that satisfy the specified constraints.
This command enables visual operations, using the operations parameter.
Images are returned as blobs in the array of blobs.
Parameters
- [optional] _ref: Reference to be used within the transaction.
- [optional] unique: Indicates whether a single object is expected to satisfy the constraints.
- [optional] constraints
- [optional] is_connected_to
- [optional] is_endpoint_of
- [optional] group_by_source
- [optional] results
- [optional] batch
- [optional] sort
- [optional] limit
- [optional] offset
- [optional] uniqueids: indicates whether unique ids will be returned as part of the response (Default: false).
- [optional] with_label
- [optional] video_ref: Reference to a video within which the frames are searched for.
- [optional] blobs: indicates whether the pixel data will be returned as part of the response (Default: false).
- [optional] operations
- [optional] in_frame_number_range
- [optional] in_time_offset_range
- [optional] in_time_fraction_range
- [optional] frame_numbers: Indicate if frame numbers should be returned as a part of the response. (Default: false)
- [optional] time_offsets: Indicate if time offsets should be returned as a part of the response. (Default: false)
- [optional] time_fractions: Indicate if time fractions should be returned as a part of the response. (Default: false)
- [optional] labels: indicates whether or not the label associated with the Frame will be retrieved
- [optional] as_format: Specify the format of the returned blobs ["jpg", "png", "tif"]. (Default: "jpg")
Details
If only one ref parameter is used in the is_connected_to array, the resulting objects obtained after traversing the given connection can be associated with their source objects by specifying the parameter group_by_source as true. Similarly, if the video_ref parameter is used, the results can be grouped by the source video. The parameter is ignored if neither is_connected_to nor video_ref is used. It is set to false by default.
Examples
Find frames which has the "topic" property equal to "car chase", and retrieve "topic" and "movie_title" properties for each frame. Note that the search is performed with no regard to the videos the frames are connected to.
[{
"FindFrame": {
"constraints": {
"topic": ["==", "car chase"]
},
"results": {
"list": ["topic", "movie_title"]
}
}
}]
Successful response:
[{
"FindFrame": {
"returned": 1,
"status": 0,
"entities": [{
"topic": "car chase",
"movie_title": "Megamind"
}]
}
}]
Similar to the above, except the search is performed over the frames that are connected to videos that have property "movie_rating" equal to "PG13":
Find videos with the property "movie_rating" equal to "PG13", then find frames that are connected to the videos and have property "topic" equal to "car chase". Returned properties of the frames are "topic" and "movie_title".
[{
"FindVideo": {
"_ref": 1,
"constraints": {
"movie_rating": ["==", "PG13"]
}
}
}, {
"FindFrame": {
"is_connected_to": {
"ref": 1
},
"constraints": {
"topic": ["==", "car chase"]
},
"results": {
"list": ["topic", "movie_title"]
}
}
}]
Successful response:
[{
"FindVideo": {
"returned": 0,
"status": 0
}
}, {
"FindFrame": {
"returned": 1,
"status": 0,
"entities": [{
"topic": "car chase",
"movie_title": "Megamind"
}]
}
}]