Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 38 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:

jobs:
test-gptzero:
name: Test GPTZero SDK
name: Test GPTZero-o SDK
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -29,18 +29,18 @@ jobs:
run: uv sync --all-packages --group dev

- name: Run tests
run: uv run --package gptzero pytest packages/gptzero/tests/ -v --cov=gptzero --cov-report=term-missing --cov-report=xml
run: uv run --package gptzero-o-core pytest packages/gptzero-o-core/tests/ -v --cov=gptzero_o --cov-report=term-missing --cov-report=xml

- name: Upload coverage
uses: codecov/codecov-action@v4
with:
file: packages/gptzero/coverage.xml
flags: gptzero
name: gptzero-coverage
file: packages/gptzero-o-core/coverage.xml
flags: gptzero-o-core
name: gptzero-o-core-coverage
if: always()

test-api:
name: Test GPTZero API
name: Test GPTZero-o API
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -58,10 +58,10 @@ jobs:
run: uv sync --all-packages --group dev

- name: Run linting
run: uv run --package gptzero-api ruff check packages/gptzero-api/src/
run: uv run --package gptzero-o-server ruff check packages/gptzero-o-server/src/

test-sdk:
name: Test GPTZero SDK Client
name: Test GPTZero-o SDK Client
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -79,7 +79,7 @@ jobs:
run: uv sync --all-packages --group dev

- name: Run linting
run: uv run --package gptzero-sdk ruff check packages/gptzero-sdk/src/
run: uv run --package gptzero-o-client-py ruff check packages/gptzero-o-client-py/src/

lint:
name: Lint All Packages
Expand All @@ -99,14 +99,35 @@ jobs:
- name: Install dependencies
run: uv sync --all-packages --group dev

- name: Lint gptzero
run: uv run ruff check packages/gptzero/src/ packages/gptzero/tests/
- name: Lint gptzero-o-core
run: uv run ruff check packages/gptzero-o-core/src/ packages/gptzero-o-core/tests/

- name: Lint gptzero-api
run: uv run ruff check packages/gptzero-api/src/
- name: Lint gptzero-o-server
run: uv run ruff check packages/gptzero-o-server/src/

- name: Lint gptzero-sdk
run: uv run ruff check packages/gptzero-sdk/src/
- name: Lint gptzero-o-client-py
run: uv run ruff check packages/gptzero-o-client-py/src/

- name: Lint gptzero-service
run: uv run ruff check packages/gptzero-service/src/
- name: Lint gptzero-o-web
run: uv run ruff check packages/gptzero-o-web/src/

test-integration:
name: Integration Tests
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Set up Python
run: uv python install 3.11

- name: Install dependencies
run: uv sync --all-packages --group dev

- name: Run integration tests
run: uv run --package gptzero-o-client-py pytest packages/gptzero-o-client-py/tests/test_integration.py::TestAPIClient::test_client_import -v
16 changes: 8 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ WORKDIR /app
# Copy workspace configuration and package definitions
# This allows uv to understand workspace structure without copying source code
COPY pyproject.toml uv.lock ./
COPY packages/gptzero/pyproject.toml packages/gptzero/README.md ./packages/gptzero/
COPY packages/gptzero-sdk/pyproject.toml packages/gptzero-sdk/README.md ./packages/gptzero-sdk/
COPY packages/gptzero-api/pyproject.toml packages/gptzero-api/README.md ./packages/gptzero-api/
COPY packages/gptzero-service/pyproject.toml packages/gptzero-service/README.md ./packages/gptzero-service/
COPY packages/gptzero-o-core/pyproject.toml packages/gptzero-o-core/README.md ./packages/gptzero-o-core/
COPY packages/gptzero-o-client-py/pyproject.toml packages/gptzero-o-client-py/README.md ./packages/gptzero-o-client-py/
COPY packages/gptzero-o-server/pyproject.toml packages/gptzero-o-server/README.md ./packages/gptzero-o-server/
COPY packages/gptzero-o-web/pyproject.toml packages/gptzero-o-web/README.md ./packages/gptzero-o-web/

# Install dependencies (this layer is cached unless lock/config files change)
RUN --mount=type=cache,target=/root/.cache/uv \
Expand Down Expand Up @@ -70,17 +70,17 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
# Create startup script
RUN echo '#!/bin/bash\n\
set -e\n\
echo "Starting GPTZero API on port 8000..."\n\
/app/.venv/bin/gptzero-api &\n\
echo "Starting GPTZero-o API on port 8000..."\n\
/app/.venv/bin/gptzero-o-server &\n\
API_PID=$!\n\
echo "API started with PID $API_PID"\n\
\n\
echo "Waiting for API to be ready..."\n\
sleep 5\n\
\n\
echo "Starting GPTZero Service on port 8501..."\n\
echo "Starting GPTZero-o Service on port 8501..."\n\
export GPTZERO_API_URL=http://localhost:8000\n\
/app/.venv/bin/streamlit run /app/packages/gptzero-service/src/handler.py --server.port=8501 --server.address=0.0.0.0 &\n\
/app/.venv/bin/streamlit run /app/packages/gptzero-o-web/src/handler.py --server.port=8501 --server.address=0.0.0.0 &\n\
SERVICE_PID=$!\n\
echo "Service started with PID $SERVICE_PID"\n\
\n\
Expand Down
81 changes: 41 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
# GPTZero-V
# GPTZero-o

A comprehensive image authenticity verification system through metadata analysis.
A comprehensive media content authenticity verification toolkit through metadata analysis, supporting imagery, audio, and video.

![GIF](static/GPTZero-V.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:
With the proliferation of manipulated, edited, and synthetic media across imagery, audio, and video, determining the authenticity of digital content has become increasingly challenging. GPTZero-o is a modular toolkit that helps assess media 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.
- **C2PA Metadata**: Content providers, including AI 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 content was captured by a physical device.
- **Authenticity Probability Score**: A heuristic estimate (0-100%) of the likelihood that media is non-authentic.

## 📦 Package Structure

GPTZero-V has been restructured into four modular packages:
GPTZero-o has been structured into four modular packages:

### 1. **gptzero** - Core SDK
Python SDK for image authenticity verification with structured base models, following DRY and SOLID patterns.
### 1. **gptzero-o-core** - Core SDK
Python SDK for media content authenticity verification with structured base models, following DRY and SOLID patterns.

- 📁 Location: `packages/gptzero/`
- 📁 Location: `packages/gptzero-o-core/`
- 🔧 Features: C2PA/EXIF handlers, base models, verification logic
- 📊 Test Coverage: 71% (32 tests passing)
- 📚 [Documentation](packages/gptzero/README.md)
- 📚 [Documentation](packages/gptzero-o-core/README.md)

### 2. **gptzero-api** - FastAPI Service
### 2. **gptzero-o-server** - FastAPI Service
RESTful API service exposing authenticity verification endpoints.

- 📁 Location: `packages/gptzero-api/`
- 📁 Location: `packages/gptzero-o-server/`
- 🔧 Features: FastAPI application, Pydantic models, middleware, CORS support
- 🌐 Default Port: 8000
- 📚 [Documentation](packages/gptzero-api/README.md)
- 📚 [Documentation](packages/gptzero-o-server/README.md)

### 3. **gptzero-sdk** - Python Client
Python SDK client for interacting with the GPTZero API.
### 3. **gptzero-o-client-py** - Python Client
Python SDK client for interacting with the GPTZero-o API.

- 📁 Location: `packages/gptzero-sdk/`
- 📁 Location: `packages/gptzero-o-client-py/`
- 🔧 Features: Sync/async httpx client, type-safe models, context managers
- 📚 [Documentation](packages/gptzero-sdk/README.md)
- 📚 [Documentation](packages/gptzero-o-client-py/README.md)

### 4. **gptzero-service** - Streamlit Frontend
Interactive web interface for image authenticity verification.
### 4. **gptzero-o-web** - Streamlit Frontend
Interactive web interface for media content authenticity verification.

- 📁 Location: `packages/gptzero-service/`
- 📁 Location: `packages/gptzero-o-web/`
- 🔧 Features: Streamlit UI, visual feedback, SDK integration
- 🌐 Default Port: 8501
- 📚 [Documentation](packages/gptzero-service/README.md)
- 📚 [Documentation](packages/gptzero-o-web/README.md)

## 🚀 Installation

Expand All @@ -55,10 +55,10 @@ The Docker image runs both the API and the service from the same container:

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

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

Access the services:
Expand Down Expand Up @@ -86,19 +86,19 @@ uv sync --all-packages --group dev

```bash
# Terminal 1: Start the API
uv run --package gptzero-api gptzero-api
uv run --package gptzero-o-server gptzero-o-server

# 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
uv run --package gptzero-o-web streamlit run packages/gptzero-o-web/src/handler.py
```

## 💻 Usage Examples

### Core SDK

```python
from gptzero import ImageVerifier, ImageInput
from gptzero_o import ImageVerifier, ImageInput

verifier = ImageVerifier()

Expand All @@ -119,7 +119,7 @@ print(f"Has EXIF: {result.has_exif}")
### API Client

```python
from gptzero_sdk import GPTZeroClient
from gptzero_o_client import GPTZeroClient

with GPTZeroClient(base_url="http://localhost:8000") as client:
result = client.verify_image(file_path="image.jpg")
Expand All @@ -144,14 +144,14 @@ Run the test suite:

```bash
# Test core SDK
cd packages/gptzero
pytest tests/ -v --cov=gptzero
cd packages/gptzero-o-core
pytest tests/ -v --cov=gptzero_o

# 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 ../..
cd packages/gptzero-o-core && ruff check src/ tests/ && cd ../..
cd packages/gptzero-o-server && ruff check src/ && cd ../..
cd packages/gptzero-o-client-py && ruff check src/ && cd ../..
cd packages/gptzero-o-web && ruff check src/ && cd ../..
```

## 🔄 CI/CD
Expand All @@ -170,28 +170,29 @@ The workflow includes:
- **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.
- **Various types of non-authentic content exist** beyond AI-generated media.
- **Metadata analysis alone is insufficient** for comprehensive authenticity verification.
- **Currently focused on imagery**, with audio and video support planned for future releases.

## 🏗️ Architecture

```
┌─────────────────────────────────────────────┐
gptzero-service (Streamlit) │
│ gptzero-o-web (Streamlit) │
│ Port 8501 │
└────────────────┬────────────────────────────┘
│ SDK Client
┌─────────────────────────────────────────────┐
gptzero-api (FastAPI) │
│ gptzero-o-server (FastAPI) │
│ Port 8000 │
└────────────────┬────────────────────────────┘
│ Uses
┌─────────────────────────────────────────────┐
gptzero (Core SDK)
│ gptzero-o-core (Core SDK) │
│ - Models & Handlers │
│ - C2PA/EXIF Extraction │
│ - Verification Logic │
Expand All @@ -210,7 +211,7 @@ Contributions are welcome! Please follow these steps:

```bash
# Install development dependencies
cd packages/gptzero
cd packages/gptzero-o-core
pip install -e ".[dev]"

# Run tests before committing
Expand All @@ -224,4 +225,4 @@ See the [LICENSE](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.
As digital content manipulation becomes more sophisticated across imagery, audio, and video, 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 for all media types.
74 changes: 74 additions & 0 deletions docs/2025-12-29-github-about-proposal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# GitHub Repository About Section - Proposal

## Short Description
A comprehensive media content authenticity toolkit for verifying audio, video, and imagery through metadata analysis using C2PA and EXIF standards.

## Tags (Topics)
- `content-authenticity`
- `media-verification`
- `metadata-analysis`
- `c2pa`
- `exif`
- `ai-detection`
- `deepfake-detection`
- `python`
- `fastapi`
- `streamlit`

---

## Rationale

### Description Changes
**Old:** "A simple attempt at a heuristic GPTZero algorithm for image authenticity verification through metadata analysis"

**New:** "A comprehensive media content authenticity toolkit for verifying audio, video, and imagery through metadata analysis using C2PA and EXIF standards"

**Changes:**
1. Removed "simple attempt at a heuristic GPTZero algorithm" - sounds more professional and production-ready
2. Changed "image authenticity verification" to "media content authenticity" - reflects the expanded scope
3. Added "audio, video, and imagery" - explicitly mentions the supported media types
4. Added "using C2PA and EXIF standards" - highlights the standards-based approach
5. Changed from "simple attempt" to "comprehensive toolkit" - positions it as a complete solution

### Tag Changes
**Old Tags:**
- `metadata`
- `image-generation`
- `heuristic-algorithm`
- `content-authenticity`

**New Tags:**
- `content-authenticity` (kept)
- `media-verification` (new - broader scope)
- `metadata-analysis` (more specific than just "metadata")
- `c2pa` (new - highlights C2PA standard support)
- `exif` (new - highlights EXIF metadata support)
- `ai-detection` (new - relevant use case)
- `deepfake-detection` (new - relevant use case)
- `python` (new - primary language)
- `fastapi` (new - key technology used)
- `streamlit` (new - key technology for UI)

**Removed:**
- `image-generation` - too specific, toolkit is about verification not generation
- `heuristic-algorithm` - too technical/implementation detail, not user-facing

**Added:**
- More specific technology tags to help discoverability
- Use-case tags (ai-detection, deepfake-detection) for better reach
- Standards tags (c2pa, exif) to highlight compliance

---

## How to Update

### On GitHub.com:
1. Navigate to the repository page
2. Click the gear icon (⚙️) next to "About" on the right sidebar
3. Update the "Description" field with the new description
4. Add the new tags in the "Topics" field (up to 20 topics allowed)
5. Click "Save changes"

### Note:
The repository name remains `GPTZero-V` on GitHub (URL: github.com/DiTo97/GPTZero-V) but all internal references, code, and documentation now use `GPTZero-o` branding. This is intentional to preserve existing links and references while the rebranding reflects the project's evolution.
Loading