Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release readme #70

Merged
merged 6 commits into from
Oct 1, 2024
Merged
Changes from 2 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
7 changes: 5 additions & 2 deletions docs/Mining.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,16 @@ cd base_miner/UCF/ && python train_detector.py
```
The model with the lowest validation accuracy will be saved to `base_miner/UCF/logs/training/<experiment_name>/`.<br>

In this directory, you will find your model weights (`ckpt_best.pth`) and training configuration (`config.yaml`).
In this directory, you will find your model weights (`ckpt_best.pth`) and training configuration (`config.yaml`). Note that
the training config, e.g. `config.yaml`, is different from the detector config, e.g. `ucf.yaml`.

You will need to put the path to the training configuration file `config.yaml` into the detector configuration file `ucf.yaml` to instantiate `UCFDetector(DeepfakeDetector`, as it uses the settings from training time to reconstruct the correct model layer shapes for inference.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Suggestion] move this to a UCF specific note in the Deploy Your Model section, or add something prefacing this saying this is something that must be done after training/before deploying


## Deploy Your Model

Once you've trained your own detector model, you can simply update the configuration file for your miner to point to your new `.pth` file.
- Your detector type and associated config file are set in `miner.env`.
- The detector config file (e.g., `ucf.yaml`) live in `base_miner/deepfake_detectors/configs/`.
- The detector config file (e.g., `ucf.yaml`) lives in `base_miner/deepfake_detectors/configs/`.
- The model weights file (e.g., `ckpt_best.pth`) should be placed in `base_miner/<detector_type>/weights`.
- If the weights specified in the config file do not exist, the miner will attempt to automatically download them from Hugging Face as specified by the `hf_repo` field in the config file. Feel free to use your own Hugging Face repository for hosting your model weights, and update the config file accordingly.

Expand Down
Loading