Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 0c70963a authored by KOPANAS Georgios's avatar KOPANAS Georgios
Browse files

texture width | num cams | try-catch exception

parent f88b6382
Branches
Tags
No related merge requests found
...@@ -55,8 +55,8 @@ int main(int ac, char** av) { ...@@ -55,8 +55,8 @@ int main(int ac, char** av) {
raycaster->init(); raycaster->init();
raycaster->addMesh(scene->proxies()->proxy()); raycaster->addMesh(scene->proxies()->proxy());
Vector2u neuralRenderResolution(900, Vector2u neuralRenderResolution(int(myArgs.texture_width),
600); int(myArgs.texture_width/1.5));
Vector2u totalResolution; Vector2u totalResolution;
if (myArgs.debug_mode) { if (myArgs.debug_mode) {
totalResolution[0] = 3 * neuralRenderResolution[0]; totalResolution[0] = 3 * neuralRenderResolution[0];
...@@ -81,6 +81,7 @@ int main(int ac, char** av) { ...@@ -81,6 +81,7 @@ int main(int ac, char** av) {
myArgs.ogl_data_path, myArgs.ogl_data_path,
myArgs.splat_layers, myArgs.splat_layers,
myArgs.tensorboard_path.get() + "/neural_renderer/model_" + myArgs.iteration.get(), myArgs.tensorboard_path.get() + "/neural_renderer/model_" + myArgs.iteration.get(),
myArgs.input_cams,
myArgs.debug_mode)); myArgs.debug_mode));
// Add views to mvm. // Add views to mvm.
MultiViewManager multiViewManager(window, false); MultiViewManager multiViewManager(window, false);
......
...@@ -48,6 +48,8 @@ namespace sibr { ...@@ -48,6 +48,8 @@ namespace sibr {
ArgSwitch leave_one_out = { "leave_one_out", false, "Leave one out rendering." }; ArgSwitch leave_one_out = { "leave_one_out", false, "Leave one out rendering." };
Arg<int> splat_layers = { "splat_layers", 10, "Number of layers for layered rendering." }; Arg<int> splat_layers = { "splat_layers", 10, "Number of layers for layered rendering." };
Arg<int> input_cams = { "input_cams", 9, "Number of input cameras used to render each novel view." }; Arg<int> input_cams = { "input_cams", 9, "Number of input cameras used to render each novel view." };
Arg<int> texture_width = { "texture-width", 900, "Horizontal resolution of the rendering, the vertical will be 1.5 smaller."};
}; };
} }
......
...@@ -14,6 +14,7 @@ namespace sibr ...@@ -14,6 +14,7 @@ namespace sibr
const std::string& ogl_data_path, const std::string& ogl_data_path,
const int splatLayers, const int splatLayers,
const std::string& model_path, const std::string& model_path,
const int input_cams,
const int debug_mode) : const int debug_mode) :
_window(window), _scene(scene), _camHandle(camHandle), _totalResolution(totalResolution), _neuralRenderResolution(neuralRenderResolution), _layerCount(splatLayers) _window(window), _scene(scene), _camHandle(camHandle), _totalResolution(totalResolution), _neuralRenderResolution(neuralRenderResolution), _layerCount(splatLayers)
{ {
...@@ -39,7 +40,7 @@ namespace sibr ...@@ -39,7 +40,7 @@ namespace sibr
//SIBR_LOG << "proxyDepthRes: " << proxyDepthRes << std::endl; //SIBR_LOG << "proxyDepthRes: " << proxyDepthRes << std::endl;
_activeCamCount = 8 + 1; _activeCamCount = input_cams;
_featureCount = _scene->_features[0].sizes()[1]; _featureCount = _scene->_features[0].sizes()[1];
_featureTextureCount = int(ceil(_featureCount / 3.f)); _featureTextureCount = int(ceil(_featureCount / 3.f));
const int splatLayerCount = _layerCount * _activeCamCount; const int splatLayerCount = _layerCount * _activeCamCount;
...@@ -647,8 +648,17 @@ namespace sibr ...@@ -647,8 +648,17 @@ namespace sibr
run_inputNet.push_back(features_stack); run_inputNet.push_back(features_stack);
run_inputNet.push_back(w); run_inputNet.push_back(w);
torch::Tensor final = _neural_renderer.forward(run_inputNet).toTensor(); torch::Tensor final;
try {
final = _neural_renderer.forward(run_inputNet).toTensor();
}
catch (const c10::Error& e) {
std::cerr << e.msg() << std::endl;
std::cerr << "Error while executing the model\n";
SIBR_ERR;
}
if (exclude_view == -1) { if (exclude_view == -1) {
final += final * (1.0 - _scene->exp_coef_mean); final += final * (1.0 - _scene->exp_coef_mean);
} }
......
...@@ -23,6 +23,7 @@ namespace sibr ...@@ -23,6 +23,7 @@ namespace sibr
const std::string& ogl_data_path, const std::string& ogl_data_path,
const int splatLayers, const int splatLayers,
const std::string& model_path, const std::string& model_path,
const int input_cams,
const int debug_mode); const int debug_mode);
virtual void onUpdate(Input& input, const Viewport& viewport); virtual void onUpdate(Input& input, const Viewport& viewport);
virtual void onRenderIBR(sibr::IRenderTarget& dst, const sibr::Camera& eye); virtual void onRenderIBR(sibr::IRenderTarget& dst, const sibr::Camera& eye);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment