Skip to content

Commit b729c4c

Browse files
authored
update livestock model, add contributor and update hugging face docs (#910)
* update livestock model, add contributor and update hugging face docs
1 parent b723daf commit b729c4c

File tree

5 files changed

+41
-3
lines changed

5 files changed

+41
-3
lines changed

AUTHORS.rst

+5-1
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,9 @@ Primary Authors
3333
Other Contributors
3434
==================
3535

36+
Special thanks to:
37+
38+
* Cameron Appel (https://github.com/camappel) for help improving the livestock model.
39+
3640
Check GitHub for recent `contributors <https://github.com/weecology/DeepForest/graphs/contributors>`_.
37-
We would like to thank everyone who has contributed to the project in any way.
41+
We would like to thank everyone who has contributed to the project in any way.

CONTRIBUTING.rst

+29
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,32 @@ Note:
182182
Do not commit the build directory after making html.
183183

184184
This version correctly follows reStructuredText (reST) conventions and includes code blocks, inline literals, and proper linking. Let me know if you need further adjustments!
185+
186+
187+
Upload to Hugging Face Hub
188+
^^^^^^^^^^^^^^^^^^^^^^^^^^^
189+
190+
To upload a trained model to the weecology organization space on Hugging Face Hub:
191+
192+
1. Train or load your model checkpoint
193+
2. Set the label dictionary to match your classes
194+
3. Use push_to_hub with the weecology organization name
195+
196+
For example:
197+
198+
.. code-block:: python
199+
200+
from deepforest import main
201+
202+
# Load model from checkpoint
203+
model = main.deepforest.load_from_checkpoint("path/to/checkpoint.ckpt")
204+
205+
# Set label dictionary mapping class names to indices
206+
model.label_dict = {"Livestock": 0}
207+
208+
# Push to weecology organization space
209+
model.push_to_hub("weecology/deepforest-livestock")
210+
211+
The model will be uploaded to https://huggingface.co/weecology/[model-name]
212+
213+
Note: You must have appropriate permissions in the weecology organization to upload models.

docs/user_guide/02_prebuilt.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,14 @@ For more information, or specific questions about the bird detection, please cre
5252

5353
## Livestock Detectors model
5454

55-
This model has a single label 'cattle' trained on drone imagery of cows, sheep and other large mammals in agricultural settings. The model was trained on data from [insert countries and other metadata about landscapes].
55+
This model has a single label 'cattle' trained on drone imagery of cows, sheep and other large mammals in agricultural settings.
5656

5757
![image](../../www/livestock-example.png)
5858

59+
The model was improved by @camappel and a nice notebook illustrates its improvement here: https://edsbook.org/notebooks/gallery/95199651-9e81-4cae-a3a7-66398a9a5f62/notebook.
60+
61+
![alt text](../../www/finetune_cattle_predictions.png)
62+
5963
```
6064
# Load deepforest model and set bird label
6165
m = main.deepforest()

docs/user_guide/10_better.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ Annotate local training data
6868
Ultimately, training a proper model with local data is the best chance
6969
at getting good performance. See ``DeepForest.train()``
7070

71-
Issues
71+
Here is a nice example of training a model on local data from a user in [cattle detection](https://edsbook.org/notebooks/gallery/95199651-9e81-4cae-a3a7-66398a9a5f62/notebook).
72+
7273
------
7374

7475
We welcome feedback on both the python package as well as the algorithm

www/finetune_cattle_predictions.png

523 KB
Loading

0 commit comments

Comments
 (0)