mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-15 00:12:38 +02:00
Rewrite how tensorflow works
This commit is contained in:
@@ -28,7 +28,7 @@ module.exports = class AnimeEyesCommand extends Command {
|
||||
const leftEye = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'anime-eyes', 'left.png'));
|
||||
const rightEye = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'anime-eyes', 'right.png'));
|
||||
const imgData = await request.get(image);
|
||||
const faces = await this.client.detectFaces(imgData.body);
|
||||
const faces = await this.client.tensorflow.detectFaces(imgData.body);
|
||||
if (!faces) return msg.reply('There are no faces in this image.');
|
||||
if (faces === 'size') return msg.reply('This image is too large.');
|
||||
const base = await loadImage(imgData.body);
|
||||
|
||||
@@ -34,7 +34,7 @@ module.exports = class DannyDevitoCommand extends Command {
|
||||
async run(msg, { image }) {
|
||||
const danny = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'danny-devito.png'));
|
||||
const imgData = await request.get(image);
|
||||
const faces = await this.client.detectFaces(imgData.body);
|
||||
const faces = await this.client.tensorflow.detectFaces(imgData.body);
|
||||
if (!faces) return msg.reply('There are no faces in this image.');
|
||||
if (faces === 'size') return msg.reply('This image is too large.');
|
||||
const base = await loadImage(imgData.body);
|
||||
|
||||
@@ -41,7 +41,7 @@ module.exports = class EmojiFaceCommand extends Command {
|
||||
const emojiData = await request.get(emojiURL);
|
||||
const emojiImg = await loadImage(emojiData.body);
|
||||
const imgData = await request.get(image);
|
||||
const faces = await this.client.detectFaces(imgData.body);
|
||||
const faces = await this.client.tensorflow.detectFaces(imgData.body);
|
||||
if (!faces) return msg.reply('There are no faces in this image.');
|
||||
if (faces === 'size') return msg.reply('This image is too large.');
|
||||
const base = await loadImage(imgData.body);
|
||||
|
||||
@@ -26,7 +26,7 @@ module.exports = class EyesCommand extends Command {
|
||||
async run(msg, { image }) {
|
||||
const eyes = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'eyes.png'));
|
||||
const imgData = await request.get(image);
|
||||
const faces = await this.client.detectFaces(imgData.body);
|
||||
const faces = await this.client.tensorflow.detectFaces(imgData.body);
|
||||
if (!faces) return msg.reply('There are no faces in this image.');
|
||||
if (faces === 'size') return msg.reply('This image is too large.');
|
||||
const base = await loadImage(imgData.body);
|
||||
|
||||
@@ -34,7 +34,7 @@ module.exports = class ShrekCommand extends Command {
|
||||
async run(msg, { image }) {
|
||||
const shrek = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'shrek.png'));
|
||||
const imgData = await request.get(image);
|
||||
const faces = await this.client.detectFaces(imgData.body);
|
||||
const faces = await this.client.tensorflow.detectFaces(imgData.body);
|
||||
if (!faces) return msg.reply('There are no faces in this image.');
|
||||
if (faces === 'size') return msg.reply('This image is too large.');
|
||||
const base = await loadImage(imgData.body);
|
||||
|
||||
Reference in New Issue
Block a user