diff --git a/.readme/README.md b/.readme/README.md index a246bc57..a9ee147c 100644 --- a/.readme/README.md +++ b/.readme/README.md @@ -10,3 +10,7 @@ ## Grid Sample - [`grid_sample`](grid_sample.md) + +## Benchmarks + +- [`bencmarks`](benchmarks.md diff --git a/.readme/benchmarks.md b/.readme/benchmarks.md index e7ea731e..ac3cb079 100644 --- a/.readme/benchmarks.md +++ b/.readme/benchmarks.md @@ -1,36 +1,99 @@ -tests/test_cube2equi.py test_numpy_single -Func:run_cube2equi: 0.0360 -.test_numpy_batch -Func:run_cube2equi: 0.1180 -.test_torch_single -Func:run_cube2equi: 0.0218 -.test_torch_batch -Func:run_cube2equi: 0.0199 -. -tests/test_equi2cube.py test_numpy_single -Func:run_equi2cube: 0.1174 -.test_numpy_batch -Func:run_equi2cube: 0.4759 -.test_torch_single -Func:run_equi2cube: 0.0060 -.test_torch_batch -Func:run_equi2cube: 0.0205 -. -tests/test_equi2equi.py test_numpy_single -Func:run_equi2equi: 2.4446 -.test_numpy_batch -Func:run_equi2equi: 9.8693 -.test_torch_single -Func:run_equi2equi: 0.1816 -.test_torch_batch -Func:run_equi2equi: 0.5867 -. -tests/test_equi2pers.py test_numpy_single -Func:run_equi2pers: 0.0734 -.test_numpy_batch -Func:run_equi2pers: 0.2994 -.test_torch_single -Func:run_equi2pers: 0.0026 -.test_torch_batch -Func:run_equi2pers: 0.0084 -. +# Benchmarks + +Environment: +- CPU: Intel i9-9960X CPU @ 3.10 GHz +- GPU: Nvidia Qudaro RTX 8000 +- RAM: 128 GB + +RAM usage doesn't exceed 20 GB, GPU memory usage at batch 64 is roughly 45 GB. + +**Transform**|** Type**|** Method**|** Input Size**|** Output Size**|** Batch Size**|** Time (seconds)** +:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----: +cube2equi| numpy| default| 256x256| 480x240| 1| 0.0360 +cube2equi| numpy| default| 256x256| 480x240| 4| 0.1180 +cube2equi| numpy| default| 256x256| 480x240| 16| 0.4512 +cube2equi| numpy| default| 256x256| 480x240| 32| 1.0650 +cube2equi| numpy| default| 256x256| 480x240| 64| 2.1363 +cube2equi| torch| default| 256x256| 480x240| 1| 0.0218 +cube2equi| torch| default| 256x256| 480x240| 4| 0.0199 +cube2equi| torch| default| 256x256| 480x240| 16| 0.0228 +cube2equi| torch| default| 256x256| 480x240| 32| 0.0335 +cube2equi| torch| default| 256x256| 480x240| 64| 0.0438 +equi2cube| numpy| default| 4000x2000| 256x256| 1| 0.1174 +equi2cube| numpy| default| 4000x2000| 256x256| 4| 0.4759 +equi2cube| numpy| default| 4000x2000| 256x256| 16| 1.8907 +equi2cube| numpy| default| 4000x2000| 256x256| 32| 4.9468 +equi2cube| numpy| default| 4000x2000| 256x256| 64| 10.0229 +equi2cube| torch| default| 4000x2000| 256x256| 1| 0.0155 +equi2cube| torch| default| 4000x2000| 256x256| 4| 0.0328 +equi2cube| torch| default| 4000x2000| 256x256| 16| 0.0940 +equi2cube| torch| default| 4000x2000| 256x256| 32| 0.1698 +equi2cube| torch| default| 4000x2000| 256x256| 64| 0.3200 +equi2equi| numpy| default| 4000x2000| 640x320| 1| 2.4446 +equi2equi| numpy| default| 4000x2000| 640x320| 4| 9.8693 +equi2equi| numpy| default| 4000x2000| 640x320| 16| 42.6679 +equi2equi| numpy| default| 4000x2000| 640x320| 32| 96.5504 +equi2equi| numpy| default| 4000x2000| 640x320| 64| 193.8804 +equi2equi| torch| default| 4000x2000| 640x320| 1| 0.1816 +equi2equi| torch| default| 4000x2000| 640x320| 4| 0.5867 +equi2equi| torch| default| 4000x2000| 640x320| 16| 2.5047 +equi2equi| torch| default| 4000x2000| 640x320| 32| 4.4535 +equi2equi| torch| default| 4000x2000| 640x320| 64| 8.7202 +equi2pers| numpy| default| 4000x2000| 640x480| 1| 0.0734 +equi2pers| numpy| default| 4000x2000| 640x480| 4| 0.2994 +equi2pers| numpy| default| 4000x2000| 640x480| 16| 1.1730 +equi2pers| numpy| default| 4000x2000| 640x480| 32| 2.7934 +equi2pers| numpy| default| 4000x2000| 640x480| 64| 5.4712 +equi2pers| torch| default| 4000x2000| 640x480| 1| 0.0026 +equi2pers| torch| default| 4000x2000| 640x480| 4| 0.0084 +equi2pers| torch| default| 4000x2000| 640x480| 16| 0.0293 +equi2pers| torch| default| 4000x2000| 640x480| 32| 0.0447 +equi2pers| torch| default| 4000x2000| 640x480| 64| 0.0770 + + +--- + +CSV: +``` +Transform, Type, Method, Input Size, Output Size, Batch Size, Time (seconds) +cube2equi, numpy, default, 256x256, 480x240, 1, 0.0360 +cube2equi, numpy, default, 256x256, 480x240, 4, 0.1180 +cube2equi, numpy, default, 256x256, 480x240, 16, 0.4512 +cube2equi, numpy, default, 256x256, 480x240, 32, 1.0650 +cube2equi, numpy, default, 256x256, 480x240, 64, 2.1363 +cube2equi, torch, default, 256x256, 480x240, 1, 0.0218 +cube2equi, torch, default, 256x256, 480x240, 4, 0.0199 +cube2equi, torch, default, 256x256, 480x240, 16, 0.0228 +cube2equi, torch, default, 256x256, 480x240, 32, 0.0335 +cube2equi, torch, default, 256x256, 480x240, 64, 0.0438 +equi2cube, numpy, default, 4000x2000, 256x256, 1, 0.1174 +equi2cube, numpy, default, 4000x2000, 256x256, 4, 0.4759 +equi2cube, numpy, default, 4000x2000, 256x256, 16, 1.8907 +equi2cube, numpy, default, 4000x2000, 256x256, 32, 4.9468 +equi2cube, numpy, default, 4000x2000, 256x256, 64, 10.0229 +equi2cube, torch, default, 4000x2000, 256x256, 1, 0.0155 +equi2cube, torch, default, 4000x2000, 256x256, 4, 0.0328 +equi2cube, torch, default, 4000x2000, 256x256, 16, 0.0940 +equi2cube, torch, default, 4000x2000, 256x256, 32, 0.1698 +equi2cube, torch, default, 4000x2000, 256x256, 64, 0.3200 +equi2equi, numpy, default, 4000x2000, 640x320, 1, 2.4446 +equi2equi, numpy, default, 4000x2000, 640x320, 4, 9.8693 +equi2equi, numpy, default, 4000x2000, 640x320, 16, 42.6679 +equi2equi, numpy, default, 4000x2000, 640x320, 32, 96.5504 +equi2equi, numpy, default, 4000x2000, 640x320, 64, 193.8804 +equi2equi, torch, default, 4000x2000, 640x320, 1, 0.1816 +equi2equi, torch, default, 4000x2000, 640x320, 4, 0.5867 +equi2equi, torch, default, 4000x2000, 640x320, 16, 2.5047 +equi2equi, torch, default, 4000x2000, 640x320, 32, 4.4535 +equi2equi, torch, default, 4000x2000, 640x320, 64, 8.7202 +equi2pers, numpy, default, 4000x2000, 640x480, 1, 0.0734 +equi2pers, numpy, default, 4000x2000, 640x480, 4, 0.2994 +equi2pers, numpy, default, 4000x2000, 640x480, 16, 1.1730 +equi2pers, numpy, default, 4000x2000, 640x480, 32, 2.7934 +equi2pers, numpy, default, 4000x2000, 640x480, 64, 5.4712 +equi2pers, torch, default, 4000x2000, 640x480, 1, 0.0026 +equi2pers, torch, default, 4000x2000, 640x480, 4, 0.0084 +equi2pers, torch, default, 4000x2000, 640x480, 16, 0.0293 +equi2pers, torch, default, 4000x2000, 640x480, 32, 0.0447 +equi2pers, torch, default, 4000x2000, 640x480, 64, 0.0770 +``` diff --git a/.readme/cube2equi.md b/.readme/cube2equi.md index 78a84466..c4a7ad00 100644 --- a/.readme/cube2equi.md +++ b/.readme/cube2equi.md @@ -2,15 +2,6 @@ Cubemap to equirectangular transformation -## Usage - -```Python - - -``` - - - - `w_out` and `h_out` must be divisible by 8. - if `w_out, h_out` is large respect to the input cubemap, it may leave some artifacts diff --git a/.readme/equi2cube.md b/.readme/equi2cube.md index 260b0680..ee319478 100644 --- a/.readme/equi2cube.md +++ b/.readme/equi2cube.md @@ -1,31 +1,9 @@ ## equi2cube -equirectangular to cubemap transformation - -```Python -class SomeEqui2Cube(BaseEqui2Cube): - def __init__(self, w_face: int): - ... - def run(self, equi, rot, cube_format, **kwargs): - ... -``` - -### Numpy - -```Python -from equilib.equi2cube import NumpyEqui2Cube -``` - -### PyTorch - -```Python -from equilib.equi2cube import TorchEqui2Cube -``` - ### TODO: - [x] Implement `numpy` - [x] Implement `torch` - [x] Implement `torch` with batches - [x] Fix rotation axis -- [ ] Implement `c++` with `cuda` \ No newline at end of file +- [ ] Implement `c++` with `cuda` diff --git a/.readme/equi2equi.md b/.readme/equi2equi.md index 33936089..4296fa2a 100644 --- a/.readme/equi2equi.md +++ b/.readme/equi2equi.md @@ -1,29 +1,5 @@ ## equi2equi -equirectangular to equirectangular transformation - -I try to keep a common api that can be used in both `c++`, `numpy`, and `pytorch`. - -```Python -class SomeEqui2Equi(BaseEqui2Equi): - def __init__(self, h_out: int, w_out: int): - ... - def run(self, src, rot, **kwargs): - ... -``` - -### Numpy - -```Python -from equilib.equi2equi import NumpyEqui2Equi -``` - -### PyTorch - -```Python -from equilib.equi2equi import TorchEqui2Equi -``` - ### TODO: - [x] Implement `numpy` diff --git a/.readme/equi2pers.md b/.readme/equi2pers.md index 4eea917d..bf097c5e 100644 --- a/.readme/equi2pers.md +++ b/.readme/equi2pers.md @@ -2,31 +2,6 @@ equirectangular to perspective transformation -I try to keep a common api that can be used in both `c++`, `numpy`, and `pytorch`. - -```Python -class SomeEqui2Pers(BaseEqui2Pers): - def __init__(self, w_pers, h_pers, fov_x): - ... - def run(self, equi, rot, **kwargs): - ... -``` - -### Numpy - -```Python -from equilib.equi2pers import NumpyEqui2Pers -``` - -### PyTorch - -```Python -from equilib.equi2pers import TorchEqui2Pers -``` - -### C++ - -__WIP__ ### TODO: diff --git a/README.md b/README.md index 11e50186..f65a6908 100644 --- a/README.md +++ b/README.md @@ -145,6 +145,7 @@ pers_img = equi2pers( For more information about how each APIs work, take a look in [.readme](.readme/) or go through example codes in the `tests` or `demo`. +See performance and benchmarking results of the APIs in [.readme/benchmark.md](.readme/benchmark.md). ### Coordinate System: @@ -185,7 +186,7 @@ Check [CONTRIBUTING.md](./CONTRIBUTING.md) for more information ### TODO: - [ ] Documentations for each transform -- [ ] Add graphs and statistics for speed improvements +- [x] Add table and statistics for speed improvements ## Acknowledgements: diff --git a/equilib/__init__.py b/equilib/__init__.py index fa4d2e63..8c57d52a 100644 --- a/equilib/__init__.py +++ b/equilib/__init__.py @@ -16,7 +16,7 @@ "equi2pers", ] -__version__ = "0.2.0" +__version__ = "0.2.1" __author__ = "Haruya Ishikawa" __homepage__ = "www.hoge.com" __description__ = "equirectangular processing"