Skip to content

Commit

Permalink
feat: add label parameter to load
Browse files Browse the repository at this point in the history
  • Loading branch information
william-silversmith committed May 16, 2024
1 parent 3abb736 commit 81e1199
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crackle/util.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from typing import Optional

import io
import os
import gzip
Expand Down Expand Up @@ -33,9 +35,9 @@ def aload(filelike) -> CrackleArray:
"""Load a CrackleArray from a file."""
return CrackleArray(_load(filelike))

def load(filelike) -> np.ndarray:
def load(filelike, label:Optional[int] = None) -> np.ndarray:
"""Load an image from a file-like object or file path."""
return decompress(_load(filelike))
return decompress(_load(filelike), label=label)

def load_numpy(filelike):
f = io.BytesIO(_load(filelike))
Expand Down

0 comments on commit 81e1199

Please sign in to comment.