docs: clarify download stats; add usage with config.json
Browse files
README.md
CHANGED
|
@@ -32,7 +32,7 @@ det_weights = torch.load(det_path, map_location="cpu")
|
|
| 32 |
rec_weights = torch.load(rec_path, map_location="cpu")
|
| 33 |
```
|
| 34 |
|
| 35 |
-
Direct links (
|
| 36 |
|
| 37 |
- https://huggingface.co/JoyCN/PaddleOCR-Pytorch/resolve/main/ptocr_v5_server_det.pth?download=true
|
| 38 |
- https://huggingface.co/JoyCN/PaddleOCR-Pytorch/resolve/main/ptocr_v5_server_rec.pth?download=true
|
|
@@ -42,3 +42,20 @@ Direct links (also counted):
|
|
| 42 |
- Please prefer the `huggingface_hub` API (`hf_hub_download`/`snapshot_download`) instead of `git lfs` cloning for downloads to be counted in Hub stats.
|
| 43 |
- Stats update periodically; it may take some time for downloads to appear.
|
| 44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
rec_weights = torch.load(rec_path, map_location="cpu")
|
| 33 |
```
|
| 34 |
|
| 35 |
+
Direct links (not counted by default):
|
| 36 |
|
| 37 |
- https://huggingface.co/JoyCN/PaddleOCR-Pytorch/resolve/main/ptocr_v5_server_det.pth?download=true
|
| 38 |
- https://huggingface.co/JoyCN/PaddleOCR-Pytorch/resolve/main/ptocr_v5_server_rec.pth?download=true
|
|
|
|
| 42 |
- Please prefer the `huggingface_hub` API (`hf_hub_download`/`snapshot_download`) instead of `git lfs` cloning for downloads to be counted in Hub stats.
|
| 43 |
- Stats update periodically; it may take some time for downloads to appear.
|
| 44 |
|
| 45 |
+
## Download stats / 下载统计
|
| 46 |
+
|
| 47 |
+
- Hub 统计依赖“查询文件”(query files),如 `config.json`;`.pth` 不是默认查询文件。
|
| 48 |
+
- 若希望出现在统计中:先请求一次 `config.json`(GET/HEAD),再下载权重。
|
| 49 |
+
|
| 50 |
+
Example:
|
| 51 |
+
|
| 52 |
+
```python
|
| 53 |
+
from huggingface_hub import hf_hub_download
|
| 54 |
+
# Trigger stats by fetching the query file
|
| 55 |
+
_ = hf_hub_download("JoyCN/PaddleOCR-Pytorch", filename="config.json")
|
| 56 |
+
# Then download weights
|
| 57 |
+
hf_hub_download("JoyCN/PaddleOCR-Pytorch", filename="ptocr_v5_server_det.pth")
|
| 58 |
+
hf_hub_download("JoyCN/PaddleOCR-Pytorch", filename="ptocr_v5_server_rec.pth")
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
- 统计有延迟(常见数小时,最长 24–48 小时)。
|