You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+58-11Lines changed: 58 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -60,6 +60,14 @@ Test the whole backend pipeline without the GUI using this command
60
60
61
61
```sh
62
62
python trapdata/tests/test_pipeline.py
63
+
# or
64
+
ami test pipeline
65
+
```
66
+
67
+
Run all other tests with:
68
+
69
+
```sh
70
+
ami test all
63
71
```
64
72
65
73
## GUI Usage
@@ -149,19 +157,58 @@ A script is available in the repo source to run the commands above.
149
157
150
158
151
159
152
-
## KG Notes for adding new models
160
+
## Adding new models
153
161
154
-
- To add new models, save the pt and json files to:
155
-
```
156
-
~/Library/Application Support/trapdata/models
157
-
```
158
-
or wherever you set the appropriate dir in settings.
159
-
The json file is simply a dict of species name and index.
162
+
1) Create a new inference class in `trapdata/ml/models/classification.py` or `trapdata/ml/models/localization.py`. All models inherit from `InferenceBaseClass`, but there are more specific classes for classification and localization and different architectures. Choose the appropriate class to inherit from. It's best to copy an existing inference class that is similar to the new model you are adding.
163
+
164
+
2) Upload your model weights and category map to a cloud storage service and make sure the file is publicly accessible via a URL. The weights will be downloaded the first time the model is run. Alternatively, you can manually add the model weights to the configured `USER_DATA_PATH` directory under the subdir `USER_DATA_PATH/models/` (on macOS this is `~/Library/Application Support/trapdata/models`). However the model will not be available to other users unless they also manually add the model weights. The category map json file is simply a dict of species names and their indexes in your model's last layer. See the existing category maps for examples.
165
+
166
+
3) Select your model in the GUI settings or set the `SPECIES_CLASSIFICATION_MODEL` setting. If the model inherits from `SpeciesClassifier` class, it will automatically become one of the valid choices.
160
167
161
-
Then you need to create a class in `trapdata/ml/models/classification.py` or `trapdata/ml/models/localization.py` and add the model details.
168
+
## Clearing the cache & starting fresh
162
169
163
-
- To clear the cache:
170
+
Remove the index of images, all detections and classifications by removing the database file. This will not remove the images themselves, only the metadata about them. The database is located in the user data directory.
0 commit comments