Skip to content

Instantly share code, notes, and snippets.

View Nps-rf's full-sized avatar
🏠
Working from home

Nikolai Pikalov Nps-rf

🏠
Working from home
  • Moscow
  • 13:26 (UTC +03:00)
  • LinkedIn in/nps-rf
View GitHub Profile
@Nps-rf
Nps-rf / js-sharp-gaussian-noise
Last active March 3, 2023 10:30
Gaussian noise impl. with sharp for augmentation use
// Augmentation noise control
const Noise = async (image) => {
// image - путь до изображения для наложения шума
try {
let img = await sharp(image);
const metadata = await img.metadata();
const seed = Math.random(); // Рандомное значение для наложения шума
@Nps-rf
Nps-rf / isUUID.js
Created March 2, 2023 13:01
JavaScript isUUID func.
const isUUID = (value) => {
return /^[\da-f]{8}-[\da-f]{4}-[1-5][\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i.test(value);
}