Silvio Giancola commited on
Commit
22a83c8
1 Parent(s): e26127b

update README

Browse files
Files changed (1) hide show
  1. README.md +32 -3
README.md CHANGED
@@ -13,12 +13,40 @@ size_categories:
13
 
14
  # TrackingNet devkit
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  ```bash
17
  conda create -n TrackingNet python pip
18
  pip install TrackingNet
19
  ```
20
 
21
- ## Utility functions for TrackingNet
22
 
23
  ```python
24
  from TrackingNet.utils import getListSplit
@@ -36,7 +64,7 @@ print(getListSequence(split=["TRAIN_0", "TRAIN_1"])) # return list of tracking s
36
  print(getListSequence(split="TRAIN")) # return list of tracking sequences for al train splits
37
  ```
38
 
39
- ## Downloading TrackingNet
40
 
41
  ```python
42
  from TrackingNet.Downloader import TrackingNetDownloader
@@ -47,4 +75,5 @@ downloader = TrackingNetDownloader(LocalDirectory="path/to/TrackingNet")
47
 
48
  for split in getListSplit():
49
  downloader.downloadSplit(split)
50
- ```
 
 
13
 
14
  # TrackingNet devkit
15
 
16
+
17
+ ## Download from HuggingFace
18
+
19
+ ```python
20
+ from huggingface_hub import hf_hub_download
21
+ from huggingface_hub import HfApi
22
+ from huggingface_hub import login
23
+
24
+ # Login
25
+ login(token = <YOUR_TOKEN>) # https://huggingface.co/settings/tokens -> Create new token
26
+
27
+ # List files
28
+ api = HfApi()
29
+ files = api.list_repo_files(repo_id="SilvioGiancola/TrackingNet", repo_type="dataset")
30
+
31
+ # [Optional] Filter files for "TRAIN_0" spliut only
32
+ files = [file for file in files if "TRAIN_0/" in file]
33
+
34
+ # Download all files from the list
35
+ for file in files:
36
+ hf_hub_download(repo_id="SilvioGiancola/TrackingNet", filename=file, repo_type="dataset", local_dir="TrackingNet_HF")
37
+
38
+ # Download zipped TEST set
39
+ hf_hub_download(repo_id="SilvioGiancola/TrackingNet", filename="TEST.zip", repo_type="dataset", local_dir="TrackingNet_HF")
40
+
41
+ ```
42
+
43
+ ## TrackingNet pip package
44
  ```bash
45
  conda create -n TrackingNet python pip
46
  pip install TrackingNet
47
  ```
48
 
49
+ ### Utility functions for TrackingNet
50
 
51
  ```python
52
  from TrackingNet.utils import getListSplit
 
64
  print(getListSequence(split="TRAIN")) # return list of tracking sequences for al train splits
65
  ```
66
 
67
+ ### Downloading TrackingNet
68
 
69
  ```python
70
  from TrackingNet.Downloader import TrackingNetDownloader
 
75
 
76
  for split in getListSplit():
77
  downloader.downloadSplit(split)
78
+ ```
79
+