Skip to content

A comprehensive media content authenticity toolkit for verifying audio, video, and imagery through AI, watermarking and metadata analysis.

License

Notifications You must be signed in to change notification settings

DiTo97/GPTZero-V

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GPTZero-V

A comprehensive image authenticity verification system through metadata analysis.

GIF

πŸ” Overview

With the proliferation of manipulated, edited, and synthetic imagery, determining the authenticity of digital media has become increasingly challenging. GPTZero-V is a modular system that helps assess an image's authenticity by analyzing its metadata, checking for:

  • C2PA Metadata: Content providers, including AI image generation providers like OpenAI, are leveraging the C2PA standard for content authenticity and provenance tracking.
  • EXIF Metadata: Presence of consistent and valid EXIF data typically suggests the image was captured by a physical device.
  • Authenticity Probability Score: A heuristic estimate (0-100%) of the likelihood that an image is non-authentic.

πŸ“¦ Package Structure

GPTZero-V has been restructured into four modular packages:

1. gptzero - Core SDK

Python SDK for image authenticity verification with structured base models, following DRY and SOLID patterns.

  • πŸ“ Location: packages/gptzero/
  • πŸ”§ Features: C2PA/EXIF handlers, base models, verification logic
  • πŸ“Š Test Coverage: 71% (32 tests passing)
  • πŸ“š Documentation

2. gptzero-api - FastAPI Service

RESTful API service exposing authenticity verification endpoints.

  • πŸ“ Location: packages/gptzero-api/
  • πŸ”§ Features: FastAPI application, Pydantic models, middleware, CORS support
  • 🌐 Default Port: 8000
  • πŸ“š Documentation

3. gptzero-sdk - Python Client

Python SDK client for interacting with the GPTZero API.

  • πŸ“ Location: packages/gptzero-sdk/
  • πŸ”§ Features: Sync/async httpx client, type-safe models, context managers
  • πŸ“š Documentation

4. gptzero-service - Streamlit Frontend

Interactive web interface for image authenticity verification.

  • πŸ“ Location: packages/gptzero-service/
  • πŸ”§ Features: Streamlit UI, visual feedback, SDK integration
  • 🌐 Default Port: 8501
  • πŸ“š Documentation

πŸš€ Installation

Using Docker (Recommended)

The Docker image runs both the API and the service from the same container:

# Build the image
docker build -t gptzero-v:0.1 .

# Run both API (port 8000) and Service (port 8501)
docker run -p 8000:8000 -p 8501:8501 gptzero-v:0.1

Access the services:

Local Installation with uv

# Clone the repository
git clone https://github.com/DiTo97/GPTZero-V.git
cd GPTZero-V

# Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh

# Install all packages using uv workspace
uv sync --all-packages

# For development (includes pytest, ruff, etc.)
uv sync --all-packages --group dev

Running Services Locally

# Terminal 1: Start the API
uv run --package gptzero-api gptzero-api

# Terminal 2: Start the Service
export GPTZERO_API_URL=http://localhost:8000
uv run --package gptzero-service streamlit run packages/gptzero-service/src/handler.py

πŸ’» Usage Examples

Core SDK

from gptzero import ImageVerifier, ImageInput

verifier = ImageVerifier()

with open("image.jpg", "rb") as f:
    data = f.read()

result = verifier.verify(ImageInput(
    data=data,
    mime_type="image/jpeg",
    filename="image.jpg"
))

print(f"Authenticity: {result.authenticity.probability}%")
print(f"Has C2PA: {result.has_c2pa}")
print(f"Has EXIF: {result.has_exif}")

API Client

from gptzero_sdk import GPTZeroClient

with GPTZeroClient(base_url="http://localhost:8000") as client:
    result = client.verify_image(file_path="image.jpg")
    print(f"Authenticity: {result.authenticity.probability}%")

API Endpoints

# Health check
curl http://localhost:8000/health

# Verify image
curl -X POST "http://localhost:8000/v1/verify" \
  -H "Content-Type: multipart/form-data" \
  -F "[email protected]"

πŸ§ͺ Testing

Run the test suite:

# Test core SDK
cd packages/gptzero
pytest tests/ -v --cov=gptzero

# Lint all packages
cd packages/gptzero && ruff check src/ tests/ && cd ../..
cd packages/gptzero-api && ruff check src/ && cd ../..
cd packages/gptzero-sdk && ruff check src/ && cd ../..
cd packages/gptzero-service && ruff check src/ && cd ../..

πŸ”„ CI/CD

GitHub Actions workflow runs automatically on:

  • Push to main branch
  • Pull request events

The workflow includes:

  • Unit tests with coverage reporting
  • Linting for all packages
  • Multi-package validation

⚠️ Limitations

  • Metadata can be manipulated or stripped, reducing reliability as the sole authenticity measure.
  • Not all authenticity markers are covered (e.g., digital signatures, blockchain verification, watermarking).
  • Authenticity probability is heuristic, meant for demonstration purposes only.
  • Various types of non-authentic content exist beyond AI-generated imagery.
  • Metadata analysis alone is insufficient for comprehensive authenticity verification.

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         gptzero-service (Streamlit)         β”‚
β”‚              Port 8501                      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                 β”‚
                 β”‚ SDK Client
                 β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚          gptzero-api (FastAPI)              β”‚
β”‚              Port 8000                      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                 β”‚
                 β”‚ Uses
                 β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚           gptzero (Core SDK)                β”‚
β”‚   - Models & Handlers                       β”‚
β”‚   - C2PA/EXIF Extraction                    β”‚
β”‚   - Verification Logic                      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes with tests
  4. Ensure all tests pass and linting is clean
  5. Submit a pull request
# Install development dependencies
cd packages/gptzero
pip install -e ".[dev]"

# Run tests before committing
pytest tests/ -v
ruff check src/ tests/

πŸ”— License

See the LICENSE file for details.

πŸ“’ Call to Action

As digital content manipulation becomes more sophisticated, it is crucial to implement stronger verification methods across the ecosystem. Metadata analysis is just one piece of a larger authenticity verification puzzle. Future efforts should integrate multiple approaches including cryptographic verification, provenance tracking, and standardizing authenticity indicators at an industry-wide level.

About

A comprehensive media content authenticity toolkit for verifying audio, video, and imagery through AI, watermarking and metadata analysis.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •