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 |
-
|
|
|
3 |
|
4 |
## Project Overview
|
5 |
-
|
6 |
|
7 |
-
##
|
8 |
-
- **
|
9 |
-
- **
|
10 |
-
- **
|
11 |
-
- **
|
12 |
-
- **
|
|
|
|
|
13 |
|
14 |
## Data Flow & Prediction Pipeline
|
15 |
-
1. **Image Preprocessing
|
16 |
-
2. **Agent Initialization
|
17 |
-
3. **Model Inference
|
18 |
-
4. **Consensus
|
19 |
-
5. **Forensic Analysis
|
20 |
-
6. **Logging
|
21 |
-
|
22 |
-
## Developer
|
23 |
-
- **Run the App:**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
```bash
|
25 |
-
|
|
|
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
|
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
|
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:**
|
|
|
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.
|