mattdeitke
commited on
Commit
•
312c3d3
1
Parent(s):
7c95025
small smithsonian api updates
Browse files
objaverse_xl/smithsonian.py
CHANGED
@@ -12,7 +12,7 @@ import requests
|
|
12 |
from loguru import logger
|
13 |
from tqdm import tqdm
|
14 |
|
15 |
-
from .utils import get_uid_from_str
|
16 |
|
17 |
|
18 |
def load_smithsonian_metadata(download_dir: str = "~/.objaverse") -> pd.DataFrame:
|
@@ -43,10 +43,6 @@ def load_smithsonian_metadata(download_dir: str = "~/.objaverse") -> pd.DataFram
|
|
43 |
with fs.open(path) as f:
|
44 |
df = pd.read_parquet(f)
|
45 |
|
46 |
-
# add uid and license columns
|
47 |
-
df["uid"] = df["url"].apply(get_uid_from_str)
|
48 |
-
df["license"] = "CC0"
|
49 |
-
|
50 |
return df
|
51 |
|
52 |
|
@@ -92,15 +88,16 @@ def _download_smithsonian_object(
|
|
92 |
|
93 |
|
94 |
def download_smithsonian_objects(
|
95 |
-
urls: Optional[str] = None,
|
96 |
processes: Optional[int] = None,
|
97 |
download_dir: str = "~/.objaverse",
|
98 |
) -> List[Dict[str, str]]:
|
99 |
"""Downloads all Smithsonian Objects.
|
100 |
|
101 |
Args:
|
102 |
-
urls (Optional[str], optional): List of URLs to download the Smithsonian
|
103 |
-
from. If None, all Smithsonian Objects will be downloaded. Defaults
|
|
|
104 |
processes (Optional[int], optional): Number of processes to use for downloading
|
105 |
the Smithsonian Objects. If None, the number of processes will be set to the
|
106 |
number of CPUs on the machine (multiprocessing.cpu_count()). Defaults to
|
|
|
12 |
from loguru import logger
|
13 |
from tqdm import tqdm
|
14 |
|
15 |
+
from objaverse_xl.utils import get_uid_from_str
|
16 |
|
17 |
|
18 |
def load_smithsonian_metadata(download_dir: str = "~/.objaverse") -> pd.DataFrame:
|
|
|
43 |
with fs.open(path) as f:
|
44 |
df = pd.read_parquet(f)
|
45 |
|
|
|
|
|
|
|
|
|
46 |
return df
|
47 |
|
48 |
|
|
|
88 |
|
89 |
|
90 |
def download_smithsonian_objects(
|
91 |
+
urls: Optional[List[str]] = None,
|
92 |
processes: Optional[int] = None,
|
93 |
download_dir: str = "~/.objaverse",
|
94 |
) -> List[Dict[str, str]]:
|
95 |
"""Downloads all Smithsonian Objects.
|
96 |
|
97 |
Args:
|
98 |
+
urls (Optional[List[str]], optional): List of URLs to download the Smithsonian
|
99 |
+
Objects from. If None, all Smithsonian Objects will be downloaded. Defaults
|
100 |
+
to None.
|
101 |
processes (Optional[int], optional): Number of processes to use for downloading
|
102 |
the Smithsonian Objects. If None, the number of processes will be set to the
|
103 |
number of CPUs on the machine (multiprocessing.cpu_count()). Defaults to
|