Skip to main content

Agriculture Image Metadata

A Linked Data–based metadata model for agricultural image data powered by Vision+Robotics

This repository provides an ontology and python package for image dataset in agricultural domains (greenhouse, open field, arable crops, horticulture, phenotyping).

The goal is to offer a lightweight, interoperable, FAIR‑friendly schema that leverages existing ontologies and codelists, while adding only minimal project‑specific extensions where necessary.

Canonical namespace & hosting

  • Namespace: https://w3id.org/agri-image/
  • Ontology: ontology/ontology.ttl will be hosted at https://w3id.org/agri-image

Repository structure

## examples
├── examples
│   ├── custom_dataset_example.py
│   ├── filtering_class_based.py
│   ├── filtering_query_based.py
│   ├── your_custom_dataset.json
│   └── your_custom_dataset.yaml
├── metadata_vision ## Package for loading etc
...
├── ontology
│   ├── dummy_dataset_output.json
│   ├── dummy_dataset_output.ttl
│   └── ontology.ttl
LICENSE

Metadata Structure

The idea is to create a dataset that can consist of:

  • fields: consisting of
    • plots/rows
      • which have crops and weeds
      • properties of:
        • soilType
        • surfaceLayer
        • weatherConditions Data is collected by a machine/platform
  • platform: has sensors:
    • Camera: unique cam_id and properties
    • Lidar: To be implemented in near future
    • GPS: To be implemented in near future
  • images: list of images which links to field, plot, platform and sensors
# DatasetMetadata(RDFModel)
#     hasField: list[FieldMetadata] | FieldMetadata
    # hasPlot: PlotMetadata
    # plot.hasCrop: CropMetadata | list[CropMetadata]
    # plot.hasWeed: CropMetadata | list[CropMetadata]
    # platform: PlatformMetadata list[PlatformMetadata]
    # platform.hasSensor: list[CameraMetadata] | CameraMetadata]
    # images: ImageMetadata | list[ImageMetadata]

Install for deployment

pip install metadata_vision@git+https://github.com/TeamWalabi/agriculture-image-metadata.git

Folder structure for deployment

We recommend following folder structure:

dataset_name / raw_data / field_id / plot_id / platform_id / cam_id / optional[YYYYMMDD]
# although for some projects it make sense to use:
dataset_name / raw_data / field_id / plot_id / platform_id / YYYYMMDD / cam_id
## inside the folder cam_id you have
## XXX.png files and XXX.metadata.json files describing ImageMetadata
# to facilitate with the folder structure have a look at utils.file_system.py

This looks complicated but this make is ideal for:

  • Timeseries
  • Drone data with field and plots
  • Multiple machines on a field.
  • Machine is flexibile can be a:
    • harvesting robot
    • data platform
    • or in a greenhouse an device which has multiple camera's sensors

Recreate ontology

To recreate the ontology:

python3 metadata_vision/create_ontology.py

Commit / validating:

Install aditional packages

pip install -e .[test]
## validate if everything is working correctly with
pytest tests/

License

This project is licensed under the Creative Commons Attribution 4.0 International (CC BY 4.0) license. See LICENSE.

You may use, modify, and distribute the contents as long as you provide attribution.

Contributing

Suggestions and pull requests are welcome, especially for improving ontology mappings or adding reusable examples.

Contact

Metadata

Release files for agri-image-meta 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agri-image-meta 1.0.0
File Size Uploaded
agri_image_meta-1.0.0.tar.gz 61.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agri-image-meta 1.0.0
File Interpreter ABI Platform
agri_image_meta-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 106.7 kB

Release files / agri_image_meta-1.0.0.tar.gz

Download URL agri_image_meta-1.0.0.tar.gz
Size 61.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e16d564871e63a6d8134094fa1d2b1db2783ae1c590f484ddc7625322d21ace1
BLAKE2b-256 checksum
How to use checksums
66db9038a4d3dabf2a05cbc9b6249175c5f33ca804308839217072bcdad52606
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / agri_image_meta-1.0.0-py3-none-any.whl

Download URL agri_image_meta-1.0.0-py3-none-any.whl
Size 45.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
39dbd76fc1622feb862c05926aa207df5bdb64dc606e3688cbc7d8d356f12f7b
BLAKE2b-256 checksum
How to use checksums
3dd9466b8b3cab3d5c8676aa35042f0e979d5f6b41a33a17912b061ae4c6e082
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page