This file contains 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
from re import S | |
from numpy import c_ | |
from torch.nn import Conv2d | |
import torch | |
from refiners import fluxion | |
from refiners.fluxion import manual_seed | |
from refiners.foundationals.latent_diffusion.stable_diffusion_1.unet import DownBlocks | |
from torch import Tensor, no_grad |
This file contains 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
from datasets import load_dataset, DownloadManager, Image | |
from sklearn.neighbors import NearestNeighbors | |
import pandas as pd | |
from PIL import Image | |
import numpy as np | |
from sklearn.metrics import ndcg_score | |
import time | |
from joblib import Parallel, delayed | |
This file contains 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 warnings | |
import torch | |
import torch.nn.functional as F | |
import numpy as np | |
from mmcls.models.losses import Accuracy | |
from mmcls.models.builder import HEADS, build_loss, build_head | |
from mmcls.models.utils import is_tracing |
This file contains 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
const fs = require('fs') | |
const folder = 'tmp/urbansoccer-tracks/' | |
const filename = folder + '1616079689177-person-7b4a5-0-92.316992.multiview-track'; | |
const obj = JSON.parse(fs.readFileSync(filename)); | |
console.log(`# Track name : ${obj.trackId} (${obj.trackCategory})`) | |
console.log(`\n## Cam 1 screen positions : (csv format)\n`) | |
console.log('frameIndex,top,left,width,height') |
This file contains 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
// i'm using opencv4nodejs to load a file into a tensorflow tensor | |
const cv = require('opencv4nodejs'); | |
const mat = cv.imread('./tmp/lenna.png') | |
const size = {w: mat.cols, h: mat.rows} | |
const mat3 = new cv.Mat(rect.h, rect.w, cv.CV_8UC3); | |
mat.getRegion(new cv.Rect(rect.x, rect.y, rect.w, rect.h)).copyTo(mat3) |
This file contains 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
const cv = require('opencv4nodejs') | |
const tf = require('@tensorflow/tfjs-node'); | |
const h = require('hasard') | |
const mat = cv.imread('./tmp/lenna.png') | |
const rect = { | |
x: 0, | |
y: 0, | |
w: 400, | |
h: 512 |
This file contains 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 matplotlib.pyplot as plt | |
import numpy as np | |
import wave | |
import sys | |
import math | |
import contextlib | |
fname = 'test.wav' | |
outname = 'filtered.wav' |
This file contains 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
if (typeof(define) === "undefined"){ | |
console.log("[ERROR] require.js is not defined"); | |
} | |
if (typeof(sand) !== "undefined"){ | |
console.log("[ERROR] sand is already defined"); | |
} | |
var sand; | |
(function(){ | |
Array.prototype.last = String.prototype.last = function() { | |
return this[this.length - 1]; |