From c2115309aba793530f7072848154fcad97d866b1 Mon Sep 17 00:00:00 2001 From: Akash Mondal Date: Sat, 13 Jan 2024 18:31:28 +0530 Subject: Cleanup unused dependencies * remove packages, that are not a direct dependency to this project, from requirements.txt * no need to just numpy for simple sqrt operation on numbers * write code on python than using a js compiler --- g4f/Provider/bing/upload_image.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'g4f/Provider/bing/upload_image.py') diff --git a/g4f/Provider/bing/upload_image.py b/g4f/Provider/bing/upload_image.py index 329e6df4..0909e5fb 100644 --- a/g4f/Provider/bing/upload_image.py +++ b/g4f/Provider/bing/upload_image.py @@ -6,7 +6,7 @@ import json import re import io import base64 -import numpy as np +import math from PIL import Image from aiohttp import ClientSession @@ -29,8 +29,8 @@ async def upload_image( width, height = img.size max_image_pixels = image_config['maxImagePixels'] if max_image_pixels / (width * height) < 1: - new_width = int(width * np.sqrt(max_image_pixels / (width * height))) - new_height = int(height * np.sqrt(max_image_pixels / (width * height))) + new_width = int(width * math.sqrt(max_image_pixels / (width * height))) + new_height = int(height * math.sqrt(max_image_pixels / (width * height))) else: new_width = width new_height = height -- cgit v1.2.3