fffiloni commited on
Commit
d81509d
·
verified ·
1 Parent(s): 49f06e7

Update scripts_infer/anidoc_inference.py

Browse files
Files changed (1) hide show
  1. scripts_infer/anidoc_inference.py +13 -3
scripts_infer/anidoc_inference.py CHANGED
@@ -1,12 +1,22 @@
1
  import sys
 
2
 
3
  from pyparsing import col
4
- sys.path.insert(0,".")
 
 
 
 
 
 
 
 
 
 
5
 
6
  import argparse
7
  from packaging import version
8
  import glob
9
- import os
10
  from LightGlue.lightglue import LightGlue, SuperPoint, DISK, SIFT, ALIKED, DoGHardNet
11
  from LightGlue.lightglue.utils import load_image, rbd
12
  from cotracker.predictor import CoTrackerPredictor, sample_trajectories, generate_gassian_heatmap, sample_trajectories_with_ref
@@ -78,7 +88,7 @@ def get_args():
78
  )
79
  parser.add_argument("--control_image", type=str, default=None, help="Path to the output video.")
80
  parser.add_argument("--ref_image", type=str, default=None, help="Path to the output video.")
81
- parser.add_argument("--max_points", type=int, default=10)
82
 
83
  args = parser.parse_args()
84
 
 
1
  import sys
2
+ import os
3
 
4
  from pyparsing import col
5
+ sys.path.insert(0, ".")
6
+
7
+ # --- compatibility shim for old diffusers on modern huggingface_hub ---
8
+ import huggingface_hub
9
+
10
+ if not hasattr(huggingface_hub, "cached_download"):
11
+ # For this project, the symbol is mainly needed so old diffusers can import.
12
+ # In AniDoc's normal path, hf_hub_download is the closest modern equivalent.
13
+ from huggingface_hub import hf_hub_download
14
+ huggingface_hub.cached_download = hf_hub_download
15
+ # ----------------------------------------------------------------------
16
 
17
  import argparse
18
  from packaging import version
19
  import glob
 
20
  from LightGlue.lightglue import LightGlue, SuperPoint, DISK, SIFT, ALIKED, DoGHardNet
21
  from LightGlue.lightglue.utils import load_image, rbd
22
  from cotracker.predictor import CoTrackerPredictor, sample_trajectories, generate_gassian_heatmap, sample_trajectories_with_ref
 
88
  )
89
  parser.add_argument("--control_image", type=str, default=None, help="Path to the output video.")
90
  parser.add_argument("--ref_image", type=str, default=None, help="Path to the output video.")
91
+ parser.add_argument("--max_points", "--max_point", dest="max_points", type=int, default=10)
92
 
93
  args = parser.parse_args()
94