Using the headless Virtual Box
When we are testing something on the server, it’s convenient and safe to do all the things in the virtual machine to avoid crash. And this blog records the tips to use the headless virtual box.
1. Create a virtual machine
Create the headless server with specific name and ostype
1VBoxManage createvm --name "xxx" --ostype Ubuntu_64 --register
Allocate the memory for the VM
1VBoxManage modifyvm "xxx" --memory 2048 --acpi on --boot1 dvd --nic1 nat
Create a virtual ha ...
Change the kernel for Linux
This post records the procedure to change the kernel for Linux. The main processes are downloading source, configuring, building, installing and booting.
1. Install a default kernel1.1 Download the source codeYou can find the required version of Linux kernel from kernel/git/stable/linux.git - Linux kernel stable tree. And we could clone it, we can specify the version:
1git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git --depth 1 --branch v6.1.4
1.2 ConfigurationThere are di ...
Scratchapixel: Light and Shading
In this post, I’ll try to summary the method to realise the effect for direct illumination (diffuse shading, shadow, reflection, refraction, etc.). The codes can be downloaded in hudongyue1/myGL. And these methods are refer to Scratchapixel.
1 Type of Light
In general, there are two kinds of light source. The first kind of lights have their own shape and size (like sun, moon, bulb, etc.), they are somehow expensive to compute. Such lights are called area lights. The second kind of lights do not ...
Scratchapixel: Simple Ray Tracing
In this post, I try to implement a simple Ray-Tracing algorithm which support to render some basic shape (sphere, box, plane, disk). And the corresponding codes can be downloaded in hudongyue1/myGL (github.com) The reference is Scratchapixel.
1. The Whole Pipeline
The picture above shows the whole procedure in my simple ray-tracer.
2. Tool functions and ClassesDegree to radians1234inlinefloat deg2rad(const float °) { return deg * M_PI / 180;}
Clamp1234inlinefloat clamp(const float & ...
Scratchapixel: Intersection
In Ray-Tracing Rendering Technique, a very common and important method is called . It will be used to judge whether the ray will intersect with a shape (like Triangle, Sphere, Plane, Disk, etc.). Even though, we just need to care about Triangle in actual use (we choose to convert complex object into triangle mesh and compute the intersection of a ray with all these triangle). In this post, I’ll try to summary the algorithm to realise for these different shapes. And these algorithm are learned f ...
Scratchapixel: Perspective Projection Matrix
Reference to the website of Scratchapixel.
If there is an object with some points in the world coordinate, and we want to project it to the image plane of a camera. What should we do? At first, we need to transfer the object’s world coordinate to the camera coordinate. So that we can do the operation of projection in the same coordinate. And we just need to use the extrinsic matrix (related to camera’s location and posture in the world coordinate) of the camera to finish this transfer. Then, we ...
PaperReading: Events Can Make Sense
Paper: Events can make sense | Frans Kaashoek and Maxwell Krohn - Academia.edu
1 IntroductionHow to manage concurrency in network applications? There is much controversy about this issue. Event based system is a kind of method, it’s flexible and robust to load. But it has the problem called “stack ripping” which will complicate the code. As a result, it’s not easy to solve concurrency problems in events because of the property of being unreadable. To free events from the stack-ripping problem an ...
论文阅读:像素对齐的隐式函数——PIFu
1 PIFu: Pixel-Aligned Implicit Function for High-Resolution Clothed Human Digitization1.1 像素对齐的隐式函数 Pixle-Aligned Implicit Function像素对齐的隐式函数 PIFu 由两个神经网络组合而成:一个全卷积图像编码器 以及一个由多层感知机(Multi-Layer Perceptrons,MLPs)表示的连续隐式函数 ƒ,其数学表达为:
f(F(x), z(X)) = s:s \in \mathbb{R}其中 是空间中的一个 3D 点, 是 的 2D 投影点, 是点 在相机坐标空间的深度值, 是图像中 点处的图像特征。所以,PIFu 的功能即为,对于任意一个 3D 点 ,首先根据相机参数投影得到该点的 2D 点位置 以及在该相机下的深度 ,同时找到该 2D 点位置的图像特征向量 ,PIFu 的输出 就表示该点是否在物体表面。
PIFu 能奏效的关键在于输入的像素对齐的图像特征向量 ,这样学习得到的 可以在重建的模型中很好地保留图片中呈现的一些细节。同 ...
论文阅读:神经辐射场——NeRF
1 NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis1.1 使用神经辐射场表示场景 Neural Radiance Field Scene RepresentationNeRF 函数是将一个连续的场景表示为一个输入为5维向量的函数,包括一个空间点的 3D 坐标位置 ,以及视角方向 。该神经网络可以写作:
F_{\Theta}: (\mathbf{x}, \mathbf{d}) \rightarrow (\pmb{c}, \sigma)其中, 是对应位置处的密度(可以理解为不透明度), 则是从视角下该点的颜色。
具体流程为:
① 经过一个 8 层的全连接的感知机(ReLU),以 3D 坐标 为输入,得到对应的密度 以及一个256 维度的特征向量作为输出;
② 将这个特征向量以及相机视角 输入另一个全连接的感知机,并得到对应处的 RGB 颜色。
1.2 使用辐射场进行立体渲染 Volume Rendering with Radiance Fields前面,使用 NeRF 得到了 3D ...
PyTorch学习(2)——动态计算图与线性回归
参考:
PyTorch 学习笔记汇总
PyTorch中backward函数详解
1 动态图PyTorch 采用的是动态图机制(Dynamic Computational Graph),而 Tensorflow 采用的是静态图机制。(Static Computational Graph)
动态图运算和搭建同时进行,也就是可以先计算前面的节点值,再根据这些值搭建后面的计算图。而静态图需要先搭建图,然后再输入数据进行运算。
PyTorch 动态图的优点是灵活,易调节,且使用简单方便。(类似 Python 库)但是其效率相对 Tensorflow 的静态图要低不少。
2.1 计算动态图计算图是用来描述运算的有向无环图,有两个主要元素:节点 (Node) 和边 (Edge)。节点表示数据,如向量、矩阵、张量。边表示运算,如加减乘除卷积等。
一个简单的例子 ,该式子用计算图表示为:
,其中 ,。
2.2 求导对于上式,分别求 在 时,关于 、 的导数:
\frac {\partial y}{\partial m} = \frac {\partial(m^2-n^2)}{\partia ...