This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import mitsuba as mi | |
| mi.set_variant('llvm_ad_rgb') | |
| import drjit as dr | |
| radiance = 10. | |
| spp = 1 | |
| sensor_dict = { | |
| 'type': 'radiancemeter', | |
| 'film': { | |
| 'type': 'hdrfilm', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| from PIL import Image | |
| im_width = 320 | |
| im_height = 240 | |
| bn = 1 | |
| import sys | |
| sys.path.insert(0, '/home/ruizhu/Documents/Projects/semanticInverse/train') | |
| import torch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| The script loads OpenRooms HDR images (.hdr or .rgbe), scales and applies gamma correction to SRGB space. | |
| ''' | |
| import numpy as np | |
| import os.path as osp | |
| import cv2 | |
| class openrooms(data.Dataset): | |
| def __init__(self, split, ...): | |
| ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| a = torch.zeros(2, 2).float() | |
| # aa = torch.zeros(2, 2).float() | |
| b = torch.tensor([[1, 2], [3, 4]]).float() | |
| # c = torch.tensor([[15, 21], [33, 44]]).float() | |
| uub = torch.tensor([[1, 0], [1, 1]]) | |
| vvb = torch.tensor([[1, 1], [0, 1]]) | |
| uua = torch.tensor([[0, 1], [0, 1]]) | |
| vva = torch.tensor([[0, 0], [0, 1]]) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def accu_model(input_dict, if_debug=False): | |
| negative_z = False | |
| yc_est, vb, y_person, v0, vc, f_pixels_yannick = input_dict['yc_est'], input_dict['vb'], input_dict['y_person'], input_dict['v0'], input_dict['vc'], input_dict['f_pixels_yannick'] | |
| theta_yannick = input_dict['pitch_est'] | |
| f = f_pixels_yannick | |
| uc = 0 | |
| device = f.device | |
| cos = torch.cos(-theta_yannick) # looking down: theta < 0 | |
| sin = torch.sin(-theta_yannick) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import torch | |
| from torch.autograd import Variable | |
| import torch.functional as F | |
| import dataLoader | |
| import argparse | |
| import torch.optim as optim | |
| import torchvision.utils as vutils | |
| from torch.utils.data import DataLoader | |
| import faceNet | |
| import torch.nn as nn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os, pickle, glob | |
| results_path = '/home/ruizhu/Documents/Projects/adobe_rui_camera-calibration-redux/data/cocoapi/PythonAPI/results_tmp' | |
| split_name = 'test_20200102-v4_alsoDetOnGT_merge_write_RE' | |
| pickle_path = os.path.join(results_path, split_name, 'pickle') | |
| pickle_files = sorted(glob.glob(pickle_path + '/*_person.data')) | |
| print(len(pickle_files), pickle_files[:2]) | |
| for pickle_file in pickle_files[:2]: |