mattdeitke
commited on
Commit
•
5759f85
1
Parent(s):
ac3e938
small docstring updates
Browse files- objaverse_xl/objaverse_v1.py +20 -19
objaverse_xl/objaverse_v1.py
CHANGED
@@ -200,9 +200,9 @@ class SketchfabDownloader(ObjaverseSource):
|
|
200 |
https://huggingface.co/datasets/allenai/objaverse/resolve/main/{hf_object_path}
|
201 |
download_dir: The base directory to download the object to. Supports all
|
202 |
file systems supported by fsspec. Defaults to "~/.objaverse".
|
203 |
-
|
204 |
-
|
205 |
-
handle_found_object (Optional[Callable]
|
206 |
successfully found and downloaded. Here, the object has the same sha256
|
207 |
as the one that was downloaded with Objaverse-XL. If None, the object
|
208 |
will be downloaded, but nothing will be done with it. Args for the
|
@@ -212,14 +212,14 @@ class SketchfabDownloader(ObjaverseSource):
|
|
212 |
- sha256 (str): SHA256 of the contents of the 3D object.
|
213 |
- metadata (Dict[str, Any]): Metadata about the 3D object, including the
|
214 |
GitHub organization and repo names.
|
215 |
-
Return is not used.
|
216 |
-
handle_modified_object (Optional[Callable]
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
- local_path (str): Local path to the downloaded 3D object.
|
224 |
- file_identifier (str): GitHub URL of the 3D object.
|
225 |
- new_sha256 (str): SHA256 of the contents of the newly downloaded 3D
|
@@ -228,16 +228,17 @@ class SketchfabDownloader(ObjaverseSource):
|
|
228 |
it was when it was downloaded with Objaverse-XL.
|
229 |
- metadata (Dict[str, Any]): Metadata about the 3D object, including the
|
230 |
GitHub organization and repo names.
|
231 |
-
Return is not used.
|
232 |
-
handle_missing_object (Optional[Callable]
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
- file_identifier (str): GitHub URL of the 3D object.
|
237 |
- sha256 (str): SHA256 of the contents of the original 3D object.
|
238 |
- metadata (Dict[str, Any]): Metadata about the 3D object, including the
|
239 |
GitHub organization and repo names.
|
240 |
-
Return is not used.
|
|
|
241 |
|
242 |
Returns:
|
243 |
A tuple of the uid and the path to where the downloaded object. If
|
@@ -264,7 +265,7 @@ class SketchfabDownloader(ObjaverseSource):
|
|
264 |
local_path=temp_path,
|
265 |
file_identifier=file_identifier,
|
266 |
sha256=sha256,
|
267 |
-
metadata=
|
268 |
)
|
269 |
else:
|
270 |
if handle_modified_object is not None:
|
@@ -273,7 +274,7 @@ class SketchfabDownloader(ObjaverseSource):
|
|
273 |
file_identifier=file_identifier,
|
274 |
new_sha256=sha256,
|
275 |
old_sha256=expected_sha256,
|
276 |
-
metadata=
|
277 |
)
|
278 |
|
279 |
if download_dir is not None:
|
|
|
200 |
https://huggingface.co/datasets/allenai/objaverse/resolve/main/{hf_object_path}
|
201 |
download_dir: The base directory to download the object to. Supports all
|
202 |
file systems supported by fsspec. Defaults to "~/.objaverse".
|
203 |
+
expected_sha256 (str): The expected SHA256 of the contents of the downloade
|
204 |
+
object.
|
205 |
+
handle_found_object (Optional[Callable]): Called when an object is
|
206 |
successfully found and downloaded. Here, the object has the same sha256
|
207 |
as the one that was downloaded with Objaverse-XL. If None, the object
|
208 |
will be downloaded, but nothing will be done with it. Args for the
|
|
|
212 |
- sha256 (str): SHA256 of the contents of the 3D object.
|
213 |
- metadata (Dict[str, Any]): Metadata about the 3D object, including the
|
214 |
GitHub organization and repo names.
|
215 |
+
Return is not used.
|
216 |
+
handle_modified_object (Optional[Callable]): Called when a modified object
|
217 |
+
is found and downloaded. Here, the object is successfully downloaded,
|
218 |
+
but it has a different sha256 than the one that was downloaded with
|
219 |
+
Objaverse-XL. This is not expected to happen very often, because the
|
220 |
+
same commit hash is used for each repo. If None, the object will be
|
221 |
+
downloaded, but nothing will be done with it. Args for the function
|
222 |
+
include:
|
223 |
- local_path (str): Local path to the downloaded 3D object.
|
224 |
- file_identifier (str): GitHub URL of the 3D object.
|
225 |
- new_sha256 (str): SHA256 of the contents of the newly downloaded 3D
|
|
|
228 |
it was when it was downloaded with Objaverse-XL.
|
229 |
- metadata (Dict[str, Any]): Metadata about the 3D object, including the
|
230 |
GitHub organization and repo names.
|
231 |
+
Return is not used.
|
232 |
+
handle_missing_object (Optional[Callable]): Called when an object that is in
|
233 |
+
Objaverse-XL is not found. Here, it is likely that the repository was
|
234 |
+
deleted or renamed. If None, nothing will be done with the missing
|
235 |
+
object. Args for the function include:
|
236 |
- file_identifier (str): GitHub URL of the 3D object.
|
237 |
- sha256 (str): SHA256 of the contents of the original 3D object.
|
238 |
- metadata (Dict[str, Any]): Metadata about the 3D object, including the
|
239 |
GitHub organization and repo names.
|
240 |
+
Return is not used.
|
241 |
+
|
242 |
|
243 |
Returns:
|
244 |
A tuple of the uid and the path to where the downloaded object. If
|
|
|
265 |
local_path=temp_path,
|
266 |
file_identifier=file_identifier,
|
267 |
sha256=sha256,
|
268 |
+
metadata={},
|
269 |
)
|
270 |
else:
|
271 |
if handle_modified_object is not None:
|
|
|
274 |
file_identifier=file_identifier,
|
275 |
new_sha256=sha256,
|
276 |
old_sha256=expected_sha256,
|
277 |
+
metadata={},
|
278 |
)
|
279 |
|
280 |
if download_dir is not None:
|