Skip to content

Instantly share code, notes, and snippets.

View kalwalt's full-sized avatar
⛰️
Working on the mountains!

Walter Perdan kalwalt

⛰️
Working on the mountains!
View GitHub Profile
@kalwalt
kalwalt / model.pth
Last active November 17, 2025 20:08
gist for model.pth
This file has been truncated, but you can view the full file.
@kalwalt
kalwalt / basic_with_module.html
Created December 8, 2024 18:19
marker basic example with the aframe-ar module lib
<!DOCTYPE html>
<html>
<script type="importmap">
{
"imports": {
"aframe": "https://aframe.io/releases/1.6.0/aframe.min.js",
"aframe-ar": "https://raw.githack.com/AR-js-org/AR.js/features-upgrade-three.js/aframe/build/aframe-ar.module.js"
}
}
</script>
iset_content_index: -404228105
artoolkitNFT_wasm.simd.js:2832 =================================================================
put_char @ artoolkitNFT_wasm.simd.js:2832
write @ artoolkitNFT_wasm.simd.js:2781
write @ artoolkitNFT_wasm.simd.js:4441
doWritev @ artoolkitNFT_wasm.simd.js:7788
_fd_write @ artoolkitNFT_wasm.simd.js:7805
$__sanitizer::internal_write(int, void const*, unsigned long) @ sanitizer_linux.cpp:296
$__sanitizer::ReportFile::Write(char const*, unsigned long) @ sanitizer_posix.cpp:304
$__sanitizer::RawWrite(char const*) @ sanitizer_file.cpp:34
@kalwalt
kalwalt / makem.js
Created November 18, 2024 15:01
testing NFT_MarkerCreatorApp with own zlib
/*
* Simple script for running emcc on ARToolKit
* @author zz85 github.com/zz85
*/
/* Note: This was an attempt to build the internal zlib but it fails because not all the zlib fails are included */
let exec = require("child_process").exec,
path = require("path"),
fs = require("fs"),
@kalwalt
kalwalt / FilterWasm-test.v3
Created April 23, 2024 17:07
test with Vector type instead of Array (Virgil)
def imgProc_gray(width: int, height: int, channels: u8, inputData: Pointer) -> Pointer {
var imgProc = ImgProc.new(width, height, channels);
var inputData_size = width * height * channels;
var internal_data: Vector<byte> = Vector<byte>.new();
for (i = 0; i < inputData_size; i++) {
internal_data[i] = (inputData + i).load<byte>();
}
return Pointer.atContents(imgProc.grayscale(internal_data));
}
@kalwalt
kalwalt / build.sh
Created April 15, 2024 22:00
simple example for virgil and wasm
// simple build script to compile the simple.v3 file to wasm
// it is required to have the virgil/bin and virgil/bin/dev in the PATH as described in the official documentation
// https://github.com/titzer/virgil
v3c -target=wasm simple.v3
docker exec emscripten-nft npm run build
> @webarkit/jsartoolkit-nft@1.6.1 build
> node tools/makem.js; echo Built at `date`
Warning: EMSCRIPTEN environment variable not found.
If you get a "command not found" error,
do `source <path to emsdk>/emsdk_env.sh` and try again.
@kalwalt
kalwalt / CMakeLists.txt
Last active September 23, 2023 23:10
Testing cmake config file for WebARKitLIb tests, it let you succesfully compile the tests with opencv-em
cmake_minimum_required(VERSION 3.24)
project(Webarkit_tests)
# GoogleTest requires at least C++14
set(CMAKE_CXX_STANDARD 14)
# Fetch googletest v1.13.0 commit b796f7d44681514f58a683a3a71ff17c94edb0c1
include(FetchContent)
FetchContent_Declare(
googletest
@kalwalt
kalwalt / log-02-04-2023-21:26.txt
Created April 2, 2023 19:27
log of passVideoData issue
artoolkitNFT_ES6_wasm.simd.js:1631 =================================================================
put_char @ artoolkitNFT_ES6_wasm.simd.js:1631
write @ artoolkitNFT_ES6_wasm.simd.js:1580
write @ artoolkitNFT_ES6_wasm.simd.js:3044
doWritev @ artoolkitNFT_ES6_wasm.simd.js:6253
_fd_write @ artoolkitNFT_ES6_wasm.simd.js:6266
$__sanitizer::internal_write(int, void const*, unsigned long) @ 003d3eaa:0xa490c
$__sanitizer::RawWrite(char const*) @ 003d3eaa:0xa1faa
$__sanitizer::SharedPrintfCode(bool, char const*, void*) @ 003d3eaa:0xa5ef7
$byn$mgfn-shared$__sanitizer::Printf(char const*, ...) @ 003d3eaa:0xab957
{GrayScaleMedia: ƒ, WebARKitController: ƒ}
WebARKitController.js:62 [WebARKitController] WebARKit initialized
WebARKitController.js:65 WebARKit 0.1.0
WebARKitController.js:106 <video id=​"video" autoplay muted playsinline>​</video>​
example.html:25 WebARKitController {jpegCount: 0, videoWidth: 1536, videoHeight: 178, listeners: {…}, instance: {…}, …}
example.html:28 GrayScaleMedia {_source: img#refIm, _width: 1637, _height: 2048, _canvas: canvas, _flipImageProg: 'attribute vec2 position;\nvarying vec2 tex_coords;\n…on = vec4(position * vec2(1, flipY), 0.0, 1.0);\n}', …}
example.html:30 Uint8Array(3352576) [31, 31, 30, 30, 30, 31, 32, 33, 35, 34, 32, 30, 29, 29, 30, 31, 35, 33, 30, 29, 30, 32, 33, 34, 29, 27, 26, 26, 28, 28, 27, 25, 28, 28, 28, 28, 27, 25, 24, 22, 25, 24, 23, 22, 22, 23, 24, 25, 23, 23, 22, 22, 21, 21, 20, 20, 22, 22, 22, 22, 22, 22, 22, 22, 19, 19, 19, 19, 19, 19, 19, 19, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 16, 16, 16, 16, 17, 17, 17, 16, 16, 15, 15, 15, 15, 15, 14, 14, 14, 14, …]
webark