From 62ddefddbf93e1f46cfdb5a2def38e0429868ad5 Mon Sep 17 00:00:00 2001 From: Uday Uppal <81161758+uday-uppal@users.noreply.github.com> Date: Sun, 19 Jun 2022 13:23:40 +0530 Subject: [PATCH 1/2] Update README.md --- README.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/README.md b/README.md index e9a6724..8935409 100755 --- a/README.md +++ b/README.md @@ -16,6 +16,40 @@ A convolutional neural network for German traffic sign image classification. The images are photos of traffic signs. The images are classified into 43 classes. The training set contains 39209 labeled images and the test set contains 12630 images. Labels for the test set are not published. See more details [here](http://benchmark.ini.rub.de/?section=gtsrb&subsection=dataset). +### How to use with Hub +A simple way of using this dataset is with [Activeloop](https://activeloop.ai)'s python package [Hub](https://github.com/activeloopai/Hub)! + +First, run `pip install hub` (or `pip3 install hub`). + +```python +import hub +ds = hub.load('hub://activeloop/gtsrb-train') + +#check out the first image and all of its details! +import matplotlib.pyplot as plt +plt.imshow(ds.images[0].numpy()) +plt.title(f" boxes : {ds.boxes[0].numpy()},labels : {ds.labels[0].numpy()},shapes : {ds.shapes[0].numpy()},colors : {ds.colors[0].numpy()},") +plt.show() + +# train a model in pytorch +for sample in ds.pytorch(): + # ... model code here ... + +# train a model in tensorflow +for sample in ds.tensorflow(): + # ... model code here ... +``` +available tensors can be shown by printing dataset: + +```python +print(ds) + +# prints: Dataset(path='hub://activeloop/gtsrb-train', read_only=True, tensors=['images', 'boxes', 'labels', 'shapes', 'colors']) +``` + + +For more information, check out the [hub documentation](https://docs.activeloop.ai/). + # Model # [ResNet-34](https://arxiv.org/abs/1512.03385) pretrained on ImageNet dataset, then finetuned on GTSRB dataset. From 4dd396950c5022dbec8adfe0498266c0b3409547 Mon Sep 17 00:00:00 2001 From: Uday Uppal <81161758+uday-uppal@users.noreply.github.com> Date: Sun, 19 Jun 2022 14:06:52 +0530 Subject: [PATCH 2/2] Update README.md --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8935409..e195249 100755 --- a/README.md +++ b/README.md @@ -16,8 +16,9 @@ A convolutional neural network for German traffic sign image classification. The images are photos of traffic signs. The images are classified into 43 classes. The training set contains 39209 labeled images and the test set contains 12630 images. Labels for the test set are not published. See more details [here](http://benchmark.ini.rub.de/?section=gtsrb&subsection=dataset). + ### How to use with Hub -A simple way of using this dataset is with [Activeloop](https://activeloop.ai)'s python package [Hub](https://github.com/activeloopai/Hub)! +A simple way of using this dataset is with [Activeloop](https://activeloop.ai)'s python package [Hub](https://github.com/activeloopai/Hub)! First, run `pip install hub` (or `pip3 install hub`). @@ -28,7 +29,7 @@ ds = hub.load('hub://activeloop/gtsrb-train') #check out the first image and all of its details! import matplotlib.pyplot as plt plt.imshow(ds.images[0].numpy()) -plt.title(f" boxes : {ds.boxes[0].numpy()},labels : {ds.labels[0].numpy()},shapes : {ds.shapes[0].numpy()},colors : {ds.colors[0].numpy()},") +plt.title(f" boxes : {ds.boxes[0].numpy()},labels : {ds.labels[0].numpy()},shapes : {ds.shapes[0].numpy()},colors : {ds.colors[0].numpy()}") plt.show() # train a model in pytorch @@ -42,7 +43,7 @@ for sample in ds.tensorflow(): available tensors can be shown by printing dataset: ```python -print(ds) +print(ds) # prints: Dataset(path='hub://activeloop/gtsrb-train', read_only=True, tensors=['images', 'boxes', 'labels', 'shapes', 'colors']) ```