"/home/dengnc/miniconda3/lib/python3.8/site-packages/torch/nn/functional.py:3828: UserWarning: Default grid_sample and affine_grid behavior has changed to align_corners=False since 1.3.0. Please specify align_corners=True if the old behavior is desired. See the documentation of grid_sample for details.\n",
" warnings.warn(\n"
]
}
],
"outputs": [],
"source": [
"params = {\n",
" 'classroom': [\n",
...
...
@@ -137,9 +128,10 @@
" [0, 0, 0, 0, 10, 200, -50]\n",
" ],\n",
" 'barbershop': [\n",
" [0, 0, 0, 20, 0, -300, 50],\n",
" [0, 0, 0, -140, -30, 150, -250],\n",
" [0, 0, 0, -60, -30, 75, -125],\n",
" [0, 0, 0, 0, 0, 0, 0],\n",
" #[0, 0, 0, 20, 0, -300, 50],\n",
" #[0, 0, 0, -140, -30, 150, -250],\n",
" #[0, 0, 0, -60, -30, 75, -125],\n",
" ],\n",
" 'lobby': [\n",
" #[0, 0, 0, 0, 0, 75, 0],\n",
...
...
%% Cell type:code id: tags:
```
import sys
import os
import torch
import torch.nn as nn
import matplotlib.pyplot as plt
rootdir = os.path.abspath(sys.path[0] + '/../')
sys.path.append(rootdir)
torch.cuda.set_device(0)
print("Set CUDA:%d as current device." % torch.cuda.current_device())
torch.autograd.set_grad_enabled(False)
from data.spherical_view_syn import *
from configs.spherical_view_syn import SphericalViewSynConfig
from utils import netio
from utils import img
from utils import device
from utils.view import *
from components.fnr import FoveatedNeuralRenderer
def load_net(path):
config = SphericalViewSynConfig()
config.from_id(os.path.splitext(path)[0])
config.SAMPLE_PARAMS['perturb_sample'] = False
net = config.create_net().to(device.default())
netio.load(path, net)
return net
def find_file(prefix):
for path in os.listdir():
if path.startswith(prefix):
return path
return None
def load_views(data_desc_file) -> Trans:
with open(data_desc_file, 'r', encoding='utf-8') as file:
/home/dengnc/miniconda3/lib/python3.8/site-packages/torch/nn/functional.py:3828: UserWarning: Default grid_sample and affine_grid behavior has changed to align_corners=False since 1.3.0. Please specify align_corners=True if the old behavior is desired. See the documentation of grid_sample for details.