Updated Home (markdown) authored by sunner's avatar sunner
# Torchvision_sunner # Torchvision_sunner
### The flexible extension of torchvision ### The flexible extension of torchvision toward multiple image space
[![Packagist](https://img.shields.io/badge/Version-18.4.4-yellow.svg)]() [![Packagist](https://img.shields.io/badge/Version-18.4.4-yellow.svg)]()
[![Packagist](https://img.shields.io/badge/Pytorch-0.3.0-red.svg)]() [![Packagist](https://img.shields.io/badge/Pytorch-0.3.0-red.svg)]()
...@@ -30,47 +30,7 @@ Import library first ...@@ -30,47 +30,7 @@ Import library first
import torchvision_sunner.transforms as sunnertransforms import torchvision_sunner.transforms as sunnertransforms
import torchvision_sunner.data as sunnerData import torchvision_sunner.data as sunnerData
``` ```
Form dataset: And start for your flexible data processing! The more detail can be refer to [wiki](https://github.com/SunnerLi/Torchvision_sunner/wiki).
```python
# Load single image folder
dataset = sunnerData.ImageDataset(
root_list = ['./waiting_for_you_dataset/real_world'],
)
# Load multiple image folder
dataset = sunnerData.ImageDataset(
root_list = ['./waiting_for_you_dataset/real_world', './waiting_for_you_dataset/wait'],
)
```
Extra transpose method
```python
dataset = sunnerData.ImageDataset(
root_list = ['./waiting_for_you_dataset/real_world', './waiting_for_you_dataset/wait'],
transform = transforms.Compose([
sunnertransforms.Rescale((160, 320)),
sunnertransforms.ToTensor(),
# BHWC -> BCHW
sunnertransforms.Transpose(sunnertransforms.BHWC2BCHW),
sunnertransforms.Normalize([127., 127., 127.], [127., 127., 127.])
])
)
```
The wrapper of usual `Dataloader`, but it can know the whole number of batch!
```python
loader = sunnerData.ImageLoader(dataset, batch_size=32, shuffle=False, num_workers = 2)
```
Transfer the tensor into numpy, and it's similar to the usage of `ImageDataset`!
```python
batch_img = sunnertransforms.tensor2Numpy(batch_img, transform = transforms.Compose([
sunnertransforms.UnNormalize([127., 127., 127.], [127., 127., 127.]),
sunnertransforms.Transpose(sunnertransforms.BCHW2BHWC),
]))
```
Notice Notice
--- ---
* This package provides two backend image processing library working: opencv and skimage. Since the opencv can show the continuous image easily, the default library we use is opencv. On the contrary, the installation of opencv is tedious. You can choose skimage to become the backend library while it can be easily installed. * This package provides two backend image processing library working: opencv and skimage. Since the opencv can show the continuous image easily, the default library we use is opencv. On the contrary, the installation of opencv is tedious. You can choose skimage to become the backend library while it can be easily installed.
... ...
......