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 isUUID = (value) => { | |
return /^[\da-f]{8}-[\da-f]{4}-[1-5][\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i.test(value); | |
} |
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
// Augmentation noise control | |
const Noise = async (image) => { | |
// image - путь до изображения для наложения шума | |
try { | |
let img = await sharp(image); | |
const metadata = await img.metadata(); | |
const seed = Math.random(); // Рандомное значение для наложения шума |