-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.py
46 lines (38 loc) · 1.15 KB
/
demo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from src.converter import Converter
from src.enums import CONVERSION, DEVICE, SAMPLING
### GPU ###
# Convert to mercator
Converter.convert(
input="img/equi.png",
output="output/equi_to_merc_GPU_LINEAR.png",
conversion=CONVERSION.TO_MERCATOR)
# Nearest sampling
Converter.convert(
input="img/equi.png",
output="output/equi_to_merc_GPU_NEAREST.png",
conversion=CONVERSION.TO_MERCATOR,
sampling=SAMPLING.NEAREST)
# Convert to equirectangular
Converter.convert(
input="img/merc.jpg",
output="output/merc_to_equi_GPU_LINEAR.jpg",
conversion=CONVERSION.TO_EQUIRECTANGULAR)
# Nearest sampling
Converter.convert(
input="img/merc.jpg",
output="output/merc_to_equi_GPU_NEAREST.jpg",
conversion=CONVERSION.TO_EQUIRECTANGULAR,
sampling=SAMPLING.NEAREST)
### CPU ###
# Convert to mercator
Converter.convert(
input="img/equi.png",
output="output/equi_to_merc_CPU.png",
conversion=CONVERSION.TO_MERCATOR,
device=DEVICE.CPU)
# Convert to equirectangular
Converter.convert(
input="img/merc.jpg",
output="output/merc_to_equi_CPU.jpg",
conversion=CONVERSION.TO_EQUIRECTANGULAR,
device=DEVICE.CPU)