rename lib to opengait

This commit is contained in:
darkliang
2022-04-12 11:28:09 +08:00
parent ecab4bf380
commit 213b3a658f
33 changed files with 39 additions and 39 deletions
+5 -5
View File
@@ -50,11 +50,11 @@ class NewModel(BaseModel):
>
> `embeddings`, `logits` and `labels` are the input arguments of the loss function.
More information should be seen in [base_model.py](../lib/modeling/base_model.py) and [loss_aggregator.py](../lib/modeling/loss_aggregator.py).
More information should be seen in [base_model.py](../opengait/modeling/base_model.py) and [loss_aggregator.py](../opengait/modeling/loss_aggregator.py).
After finishing the model file, you have two steps left to do:
**Step 1**: Put your newmodel.py under `lib/modeling/models`.
**Step 1**: Put your newmodel.py under `opengait/modeling/models`.
**Step 2**: Specify the model name in a yaml file:
```yaml
@@ -67,7 +67,7 @@ model_cfg:
## A new loss
If you want to write a new loss, you need to write a class inherited from `lib/modeling/losses`, like this
If you want to write a new loss, you need to write a class inherited from `opengait/modeling/losses`, like this
```python
from .base import BaseLoss
@@ -81,6 +81,6 @@ class NewLoss(BaseLoss):
```
Remember to use `gather_and_scale_wrapper` to wrap your forward function if your loss is computed by pairs like `triplet`. By this, we gather all features to one GPU card and scale the loss by the number of GPUs.
Then, put your loss in `lib/modeling/losses` so that you can use it in config file.
Then, put your loss in `opengait/modeling/losses` so that you can use it in config file.
Moreover, refer to [loss_aggregator.py](../lib/modeling/loss_aggregator.py) to explore how does your defined loss work in the model.
Moreover, refer to [loss_aggregator.py](../opengait/modeling/loss_aggregator.py) to explore how does your defined loss work in the model.