-
Notifications
You must be signed in to change notification settings - Fork 648
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Edward Grigoryan
committed
Aug 7, 2020
1 parent
23b8440
commit 07f51b9
Showing
5 changed files
with
110 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
FROM python:3.6 | ||
ADD ./ /workspace | ||
WORKDIR /workspace | ||
RUN pip install -r requirements_dev.txt | ||
RUN pip install -r requirements-dev.txt | ||
RUN pip install -e /workspace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import numpy as np | ||
|
||
import hub | ||
import tensorflow as tf | ||
import torch | ||
from torch.utils.data import Dataset, DataLoader | ||
|
||
|
||
def main(): | ||
tf.enable_eager_execution() | ||
t1 = hub.tensor.from_array(np.array([1, 2, 3])) | ||
t2 = hub.tensor.from_array(np.array([4, 5, 6])) | ||
ds = hub.dataset.from_tensors({"first": t1, "second": t2}) | ||
ds = ds.to_tensorflow() | ||
for x in ds: | ||
print(x) | ||
|
||
|
||
def main2(): | ||
tf.enable_eager_execution() | ||
ds = hub.load("s3://snark-hub/public/coco/coco2017") | ||
|
||
for i in range(len(ds)): | ||
item = ds[i] | ||
print(item) | ||
for key, value in item.items(): | ||
print(key, value) | ||
print(key, value.compute()) | ||
break | ||
|
||
# ds = hub.load("s3://snark-hub/public/cifar/cifar10") | ||
# ds = hub.load("s3://snark-hub/public/mnist/mnist") | ||
# ds = ds.to_tensorflow() | ||
ds = ds.to_pytorch() | ||
ds = DataLoader(torch, num_workers=0, collate_fn=ds.collate_fn, batch_size=10) | ||
for x in ds: | ||
sample = x[0] | ||
print(sample.keys()) | ||
print(sample["id"]) | ||
break | ||
|
||
|
||
if __name__ == "__main__": | ||
main2() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pytest | ||
tensorflow>=1.14,<2 | ||
tensorflow-datasets>=3.0,<4 | ||
torch>=1,<2 | ||
waymo-open-dataset-tf-1-15-0 |
This file was deleted.
Oops, something went wrong.