Skip to main content

vdtk: Visual Description Evaluation Tools

This tool is designed to allow for a deep investigation of diversity in visual description datasets, and to help users understand their data at a token, n-gram, description, and dataset level.

Installation

To use this tool, you can easily pip install with pip install vdtk.

Data format

In order to prepare datasets to work with this tool, datasets must be formatted as JSON files with the following schema:

# List of samples in the dataset
[
    # JSON object for each sample
    {
        "_id": "string", # A string ID for each sample. This can help keep track of samples during use.
        "split": "string", # A string corresponding to the split of the data. Default splits are "train", "validate" and "test"
        "references": [
            # List of string references
            "reference 1...",
            "reference 2...",
        ],
        "candidates": [
            # List of string candidates (Optional)
            "candidate 1...",
            "candidate 2...",
        ],
        "media_path": "string", # (Optional) Path to the image/video (for image/video based metrics, recall experiemnts, etc.)
        "metadata": {} # Any JSON object. This field is not used by the toolkit at this time.
    }
]

Usage

After installation, the basic menu of commands can be accessed with vdtk --help. We make several experiments/tools available for use:

Command Details
vocab-stats Run with vdtk vocab-stats DATASET_JSON_PATH. Compute basic token-level vocab statistics
ngram-stats Run with vdtk ngram-stats DATASET_JSON_PATH. Compute n-gram statistics, EVS@N and ED@N
caption-stats Run with vdtk caption-stats DATASET_JSON_PATH. Compute caption-level dataset statistics
semantic-variance Run with vdtk semantic-variance DATASET_JSON_PATH. Compute within-sample BERT embedding semantic variance
coreset Run with vdtk coreset DATASET_JSON_PATH. Compute the caption coreset from the training split needed to solve the validation split
concept-overlap Run with vdtk concept-overlap DATASET_JSON_PATH. Compute the concept overlap between popular feature extractors, and the dataset
concept-leave-one-out Run with vdtk concept-leave-one-out DATASET_JSON_PATH. Compute the performance with a coreset of concept captions
leave-one-out Run with vdtk leave-one-out DATASET_JSON_PATH. Compute leave-one-out ground truth performance on a dataset with multiple ground truths

Additionally, several commands take multiple dataset JSONs, which can be used to compare different runs, or different datasets. Appending (:baseline) to any of the JSON file paths will treat this run as a baseline, and compute relative values and coloring accordingly (example: vdtk score cider-d ./baseline.json:baseline ./model.json).

Command Details
score Run with vdtk score [metric] DATASET_JSON_PATH_1, DATASET_JSON_PATH_2.... Compute BLEU/METEOR/CIDEr-D/ROUGE/BERTScore/MAUVE/etc. Guaranteed to be consistent with the COCO captioning tools (for use externally).
clip-recall Run with vdtk clip-recall DATASET_JSON_PATH_1, DATASET_JSON_PATH_2.... Compute the MRR, and Recall@K values for candidate/reference captions based on the CLIP model.
content-recall Run with vdtk content-recall DATASET_JSON_PATH_1, DATASET_JSON_PATH_2.... Compute Noun/Verb recall for the candidates against the references.

For more details and options, see the --help command for any of the commands above. Note that some tools are relatively compute intensive. This toolkit will make use of a GPU if available and necessary, as well as a large number of CPU cores and RAM depending on the task.

Copyright 2021, Regents of the University of California

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Metadata

Release files for vdtk 0.3.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 vdtk 0.3.0
File Size Uploaded Provenance
vdtk-0.3.0.tar.gz 521.4 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for vdtk 0.3.0
File Interpreter ABI Platform
vdtk-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.0 GB

Release files / vdtk-0.3.0.tar.gz

Download URL vdtk-0.3.0.tar.gz
Size 521.4 MB
Tags Source
SHA-256 checksum
How to use checksums
19bcff13fad8d009fca50a14dab15d920aad91f21f599f35309f196dd19e2150
BLAKE2b-256 checksum
How to use checksums
32f1432ccb4b7646661f7099f15720cc50e70d55cbb266396d90d33492492ac9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.13

Release files / vdtk-0.3.0-py3-none-any.whl

Download URL vdtk-0.3.0-py3-none-any.whl
Size 521.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
e840e3a1db458de4866af0c1fc01ea19a17e597af6bf412d831ba6b6878fa363
BLAKE2b-256 checksum
How to use checksums
1593bd800b3adbe8b35ec4dc4c1a0765d2278345fb25143ec08784397453609a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.13

Security for vdtk 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files No provenance

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