Skip to content

Instantly share code, notes, and snippets.

@983
983 / log.txt
Created March 14, 2024 10:34
Training log for ViTMatte-S. For more details, see https://github.com/hustvl/ViTMatte/issues/32
This file has been truncated, but you can view the full file.
[03/11 17:29:45 detectron2]: Rank of current process: 0. World size: 2
[03/11 17:29:46 detectron2]: Environment info:
------------------------------- -----------------------------------------------------------------------------------------------------------------------
sys.platform linux
Python 3.11.4 (main, Jul 5 2023, 13:45:01) [GCC 11.2.0]
numpy 1.26.4
detectron2 0.6 @~/ViTMatte/detectron2/detectron2
Compiler GCC 12.2
CUDA compiler CUDA 11.8
detectron2 arch flags ~/ViTMatte/detectron2/detectron2/_C.cpython-311-x86_64-linux-gnu.so; cannot find cuobjdump
@983
983 / main.c
Created August 23, 2019 14:13
Draw concave polygon using OpenGL and stencil buffer
// Build on linux:
// sudo apt install freeglut3-dev
// gcc main.c -o main -lGL -lglut
#include <GL/glut.h>
void drawVertices(GLenum mode, const void *vertices, int n_vertices){
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(2, GL_FLOAT, 0, vertices);
glDrawArrays(mode, 0, n_vertices);
}
#include <stdlib.h>
int *val; /* item values */
int ncmp; /* number of comparisons */
int nsolid; /* number of solid items */
int candidate; /* pivot candidate */
int gas; /* gas value */
#define freeze(x) val[x] = nsolid++
#include <stdlib.h>
int *val; /* item values */
int ncmp; /* number of comparisons */
int nsolid; /* number of solid items */
int candidate; /* pivot candidate */
int gas; /* gas value */
#define freeze(x) val[x] = nsolid++
@983
983 / frag.glsl
Created November 14, 2015 09:39
hsv rgb conversion glsl shader
// because http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl is often down
vec3 rgb2hsv(vec3 c)
{
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
float d = q.x - min(q.w, q.y);
float e = 1.0e-10;