LPX55 commited on
Commit
eff3634
·
1 Parent(s): 554718d

update inst

Browse files
.github/instructions/copilot-instructions.md CHANGED
@@ -1,34 +1,50 @@
1
 
2
- # Copilot Instructions for OpenSight-Deepfake-Detection-Models-Playground
 
3
 
4
  ## Project Overview
5
- This project is a modular, agent-driven toolkit for deepfake detection and digital forensics. It uses an ensemble of models, advanced forensic tools, and smart agents to provide explainable, extensible, and robust detectionoptimized for integration with vision LLMs and multimodal AI agents.
6
 
7
- ## Architecture & Key Components
8
- - **Entrypoint:** `app.py` (Gradio app + MCP server).
9
- - **Forensics:** `forensics/` (e.g., `ela.py`, `gradient.py`, `minmax.py`, `bitplane.py`, `wavelet.py`). Each file implements a forensic technique, callable via LLM/MCP.
10
- - **Agents:** `agents/` (e.g., `EnsembleMonitorAgent`, `ModelWeightManager`, `ContextualIntelligenceAgent`, `ForensicAnomalyDetectionAgent`). Agents coordinate model weighting, context inference, and anomaly detection.
11
- - **Model Management:** Models are registered in `utils/registry.py` and managed as an ensemble with dynamic, context-aware weighting.
12
- - **Utilities:** `utils/` (logging, augmentation, registry, health checks).
 
 
13
 
14
  ## Data Flow & Prediction Pipeline
15
- 1. **Image Preprocessing:** Normalize to PIL RGB; optionally augment (rotate, noise, sharpen).
16
- 2. **Agent Initialization:** Monitoring, optimization, and context agents are set up.
17
- 3. **Model Inference:** Each model predicts independently; results tracked by agents.
18
- 4. **Consensus:** Model weights are dynamically adjusted based on context and agent feedback.
19
- 5. **Forensic Analysis:** Multiple forensic tools run in parallel; outputs analyzed for anomalies.
20
- 6. **Logging:** All results (images, predictions, agent data) are logged to Hugging Face datasets.
21
-
22
- ## Developer Workflows
23
- - **Run the App:**
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  ```bash
25
- python app_optimized.py
 
26
  ```
27
- - **Dependencies:** See `requirements.txt` (notably: gradio, PIL, numpy, torch, smolagents, etc.).
28
  - **Extending Forensics/Agents:** Add new tools in `forensics/`, new agents in `agents/`, and register in the main app.
29
  - **Testing:** Unit tests for agents/models are planned (see roadmap in `README.md`).
30
 
31
- ## Project-Specific Patterns & Conventions
32
  - **Forensic Tool Naming:** Use `tool_*` or descriptive names (e.g., `tool_ela`, `tool_waveletnoise`).
33
  - **Agent Classes:** Use `*Agent` suffix (e.g., `EnsembleMonitorAgent`).
34
  - **API Exposure:** Functions are exposed for LLM/MCP calls with clear parameter/return docs (see `README.md`).
@@ -38,7 +54,7 @@ This project is a modular, agent-driven toolkit for deepfake detection and digit
38
  ## Integration & Extension
39
  - **Add Models:** Update ensemble logic and register in agent system.
40
  - **Add Forensic Tools:** Implement in `forensics/`, expose via main app, and document parameters/returns.
41
- - **LLM/Multimodal Integration:** Hybrid input strategies (e.g., ELA+RGB, metadata+image) are encouraged; see `README.md` for detailed tables and guidance.
42
 
43
  ## References
44
  - **Forensic Techniques:** See `forensics/` for implementation details.
@@ -47,4 +63,4 @@ This project is a modular, agent-driven toolkit for deepfake detection and digit
47
  - **Roadmap:** Ongoing and planned features are tracked in `README.md`.
48
 
49
  ---
50
- **Tip:** When extending or debugging, always check agent logic and consensus weighting, as these are central to system behavior.
 
1
 
2
+
3
+ # Copilot Instructions for OpenSight-Deepfake-Detection-Models-Playground (2025)
4
 
5
  ## Project Overview
6
+ OpenSight is a modular, agent-driven toolkit for deepfake detection and digital forensics. It leverages an ensemble of models, advanced forensic tools, and smart agents for explainable, extensible, and robust detection. The system is optimized for integration with vision LLMs and multimodal AI agents, and supports logging to Hugging Face datasets.
7
 
8
+ ## Key Technologies
9
+ - **Gradio**: Main UI and API server (`app.py`).
10
+ - **Hugging Face Hub**: Model and dataset management, logging, and deployment.
11
+ - **Git LFS**: Required for storing binary files (e.g., PNGs) in the repo. See `.gitattributes` for tracked types.
12
+ - **Agents**: Smart agents for ensemble monitoring, weight optimization, system health, context intelligence, and anomaly detection (`agents/`).
13
+ - **Forensic Tools**: Modular forensic techniques in `forensics/` (ELA, gradient, minmax, bitplane, wavelet, exif, etc.).
14
+ - **Model Management**: Models are registered and managed in `utils/registry.py`, loaded via ONNX/Hugging Face/Gradio API.
15
+ - **Utilities**: Logging, augmentation, health checks, and more in `utils/`.
16
 
17
  ## Data Flow & Prediction Pipeline
18
+ 1. **Image Preprocessing**: Normalize to PIL RGB, optional augmentation (rotate, noise, sharpen).
19
+ 2. **Agent Initialization**: Monitoring, optimization, and context agents setup.
20
+ 3. **Model Inference**: Each model predicts independently; results tracked by agents.
21
+ 4. **Consensus**: Model weights dynamically adjusted based on context and agent feedback.
22
+ 5. **Forensic Analysis**: Multiple forensic tools run in parallel; outputs analyzed for anomalies.
23
+ 6. **Logging**: All results (images, predictions, agent data) are logged to Hugging Face datasets (`hf_logger.py`).
24
+
25
+ ## Developer Workflow
26
+ - **Run the App:**
27
+ ```bash
28
+ python app.py
29
+ ```
30
+ - **Dependencies:** See `requirements.txt` (gradio, PIL, numpy, torch, huggingface_hub, etc.).
31
+ - **Binary Files:** All PNGs and other binaries must be tracked with Git LFS. If you see a push error, run:
32
+ ```bash
33
+ git lfs track "*.png"
34
+ git add .gitattributes
35
+ git add <yourfile.png>
36
+ git commit -m "Track PNG files with Git LFS"
37
+ git push origin main
38
+ ```
39
+ If the file is already in history, use:
40
  ```bash
41
+ git lfs migrate import --include="*.png"
42
+ git push origin main
43
  ```
 
44
  - **Extending Forensics/Agents:** Add new tools in `forensics/`, new agents in `agents/`, and register in the main app.
45
  - **Testing:** Unit tests for agents/models are planned (see roadmap in `README.md`).
46
 
47
+ ## Project Patterns & Conventions
48
  - **Forensic Tool Naming:** Use `tool_*` or descriptive names (e.g., `tool_ela`, `tool_waveletnoise`).
49
  - **Agent Classes:** Use `*Agent` suffix (e.g., `EnsembleMonitorAgent`).
50
  - **API Exposure:** Functions are exposed for LLM/MCP calls with clear parameter/return docs (see `README.md`).
 
54
  ## Integration & Extension
55
  - **Add Models:** Update ensemble logic and register in agent system.
56
  - **Add Forensic Tools:** Implement in `forensics/`, expose via main app, and document parameters/returns.
57
+ - **LLM/Multimodal Integration:** Hybrid input strategies (e.g., ELA+RGB, metadata+image) are encouraged; see `README.md` for details.
58
 
59
  ## References
60
  - **Forensic Techniques:** See `forensics/` for implementation details.
 
63
  - **Roadmap:** Ongoing and planned features are tracked in `README.md`.
64
 
65
  ---
66
+ **Tip:** Always check agent logic and consensus weighting when extending or debugging, as these are central to system behavior. For binary file push errors, ensure Git LFS is set up and files are tracked correctly.