Skip to content

Instantly share code, notes, and snippets.

View 26medias's full-sized avatar

Julien Loutre 26medias

View GitHub Profile
const readline = require('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
let inputData = '';
rl.on('line', (input) => {
inputData += input + '\n';
@26medias
26medias / data_processing_cv.py
Created September 2, 2020 18:25
TensorRT YoloV3 running on a video via OpenCV
#
# Copyright 1993-2020 NVIDIA Corporation. All rights reserved.
#
# NOTICE TO LICENSEE:
#
# This source code and/or documentation ("Licensed Deliverables") are
# subject to NVIDIA intellectual property rights under U.S. and
# international Copyright laws.
#
# These Licensed Deliverables contained herein is PROPRIETARY and
@26medias
26medias / automl-vision-node.js
Last active April 18, 2024 21:04
Google Automl Vision: Using a trained tfjs model in NodeJS to classify an image (full working example)
const tf = require("@tensorflow/tfjs-node");
const automl = require("@tensorflow/tfjs-automl");
// Tensorflow Inference
var tfInference = {
loadDictionary: function(modelUrl) {
const lastIndexOfSlash = modelUrl.lastIndexOf("/");
const prefixUrl = lastIndexOfSlash >= 0 ? modelUrl.slice(0, lastIndexOfSlash + 1) : "";
const dictUrl = path.normalize(path.dirname(modelUrl)+'/dict.txt');
const text = fs.readFileSync(dictUrl, { encoding: "utf-8" });
@26medias
26medias / gif.py
Created January 3, 2018 05:41 — forked from xyfeng/gif.py
python script turn images into gif
# From https://github.com/wnyc/PIL/blob/master/Scripts/gifmaker.py
#
# The Python Imaging Library
# $Id$
#
# convert sequence format to GIF animation
#
# history:
# 97-01-03 fl created
#
@26medias
26medias / MD to Object
Created June 22, 2017 22:45
NodeJS code to convert a MD style formatting to a JS object
var fstool = require('fs-tool');
var _ = require('underscore');
var path = require('path');
var pstack = require('pstack');
var log = function(a,b) {
console.log("#["+a+"]",JSON.stringify(b,null,4));
}
@26medias
26medias / pagevamp-vampbox
Last active August 29, 2015 14:15
Vampbox
Full-size:
<html>
<head>
<link rel="stylesheet" type="text/css" href="http://pagevamp.dev/pagevamp/system/libs/clientside/template-agency/css/vampbox.css">
<script type="text/javascript">
(function(window, code, lang, domain) {
var callbackName = 'vamp_'+code;
var inIframe = window.location != window.parent.location;
function _pvLoadEvent(func) {
// Resize the ad
var initAnim = function() {
// Init the styles
move(el.anim).scale(1.5).set('opacity', 0).duration('0ms').end();
// Wait one sec to do anything
setTimeout(function() {
// Alpha change for 1.8 sec
move(el.anim).set('opacity', 0.6).duration('1,8s').end();
// wait 1.8sec for the alpha to finish