objectHashes
to your agent. Your agent can then use the dep_objects
method to gain immediate access to these specific object instances, which greatly simplifies integrating your OCR model for targeted processing.
Test the Agent
agent.py
.Copy URL
as shown:"https://app.encord.com/label_editor/{project_hash}/{data_hash}/{frame}/0?other_query_params&objectHash={objectHash}"
.OntologyDataModel
for classifications.Ontology JSON and Script
dep_single_frame
dependency.See the contents of data_model.model_json_schema_str here
"https://app.encord.com/label_editor/{project_hash}/{data_hash}/{frame}"
.OntologyDataModel
and the dep_object_crops
dependency.
"generic"
.
Ontology JSON and Script
"generic"
. The generic object is used to query image crops within the agent. Before that, other_objects
is used to pass in the specific context we want Claude to focus on. The OntologyDataModel
class helps convert Encord Ontology Objects into a Pydantic model and parse JSON into Encord ObjectInstances.
data_model
to generate the JSON schema. Only other_objects
is passed to ensure the model can choose only from non-generic object types.
dep_object_crops
dependency allows filtering. In this case, it includes only “generic” object crops, excluding those already converted to actual labels.crop
variable has a convenient b64_encoding
method to produce an input that Claude understands.
data_model
. When called with a JSON string, it attempts to parse it with respect to the JSON schema we saw above to create an Encord object instance. If successful, the old generic object can be removed and the newly classified object added.
See the result of `data_model.model_json_schema_str` for the given example
"https://app.encord.com/label_editor/{project_hash}/{data_hash}/{frame}"
.Ontology JSON and Script
requirements.txt
file.
/path/to/your_private_key
and <your-api-key>
with your actual credentials.)
<url_from_the_label_editor>
with the URL from your Encord Label Editor session.)