From 256296e34de4e2779c6bc38d54f2ff4e535fc8c5 Mon Sep 17 00:00:00 2001 From: nitesh Date: Tue, 3 May 2022 19:22:33 +0530 Subject: [PATCH 1/4] Resize functionality added to bing class --- .gitignore | 3 +- README.md | 2 +- bing_image_downloader.egg-info/PKG-INFO | 82 +++++++++++++++++++ bing_image_downloader.egg-info/SOURCES.txt | 11 +++ .../dependency_links.txt | 1 + bing_image_downloader.egg-info/top_level.txt | 1 + bing_image_downloader/bing.py | 37 +++++++-- bing_image_downloader/downloader.py | 4 +- resize/__init__.py | 0 resize/resize.py | 23 ++++++ 10 files changed, 151 insertions(+), 13 deletions(-) create mode 100644 bing_image_downloader.egg-info/PKG-INFO create mode 100644 bing_image_downloader.egg-info/SOURCES.txt create mode 100644 bing_image_downloader.egg-info/dependency_links.txt create mode 100644 bing_image_downloader.egg-info/top_level.txt create mode 100644 resize/__init__.py create mode 100644 resize/resize.py diff --git a/.gitignore b/.gitignore index ec358d5..878c5ec 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ dataset/* dataset dist image_search.egg-info -**/.vscode/* \ No newline at end of file +**/.vscode/* +bing_image_downloader.egg-info/ \ No newline at end of file diff --git a/README.md b/README.md index 7d251db..cafd119 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ pip install . ### Usage
```python from bing_image_downloader import downloader -downloader.download(query_string, limit=100, output_dir='dataset', adult_filter_off=True, force_replace=False, timeout=60, verbose=True) +downloader.download(query_string, limit=100, output_dir='dataset', adult_filter_off=True, force_replace=False, timeout=60,resize=(224,224) ,verbose=True) ``` `query_string` : String to be searched.
diff --git a/bing_image_downloader.egg-info/PKG-INFO b/bing_image_downloader.egg-info/PKG-INFO new file mode 100644 index 0000000..eba6059 --- /dev/null +++ b/bing_image_downloader.egg-info/PKG-INFO @@ -0,0 +1,82 @@ +Metadata-Version: 2.1 +Name: bing-image-downloader +Version: 1.1.2 +Summary: Python library to download bulk images from Bing.com +Home-page: https://github.com/gurugaurav/bing_image_downloader +Author: Guru Prasad Singh +Author-email: g.gaurav541@gmail.com +License: UNKNOWN +Keywords: bing,images,scraping,image download,bulk image downloader +Platform: UNKNOWN +Classifier: Programming Language :: Python :: 3 +Classifier: License :: OSI Approved :: MIT License +Classifier: Operating System :: OS Independent +Description-Content-Type: text/markdown +License-File: LICENSE + +![GitHub top language](https://img.shields.io/github/languages/top/gurugaurav/bing_image_downloader) +![GitHub](https://img.shields.io/github/license/gurugaurav/bing_image_downloader) +[![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fgurugaurav%2Fbing_image_downloader&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false)](https://hits.seeyoufarm.com) +## Bing Image Downloader +
+ +Python library to download bulk of images form Bing.com. +This package uses async url, which makes it very fast while downloading.
+ + +### Disclaimer
+ +This program lets you download tons of images from Bing. +Please do not download or use any image that violates its copyright terms. + +### Installation
+```sh +pip install bing-image-downloader +``` + +or +```bash +git clone https://github.com/gurugaurav/bing_image_downloader +cd bing_image_downloader +pip install . +``` + + + +### Usage
+```python +from bing_image_downloader import downloader +downloader.download(query_string, limit=100, output_dir='dataset', adult_filter_off=True, force_replace=False, timeout=60, verbose=True) +``` + +`query_string` : String to be searched.
+`limit` : (optional, default is 100) Number of images to download.
+`output_dir` : (optional, default is 'dataset') Name of output dir.
+`adult_filter_off` : (optional, default is True) Enable of disable adult filteration.
+`force_replace` : (optional, default is False) Delete folder if present and start a fresh download.
+`timeout` : (optional, default is 60) timeout for connection in seconds.
+`filter` : (optional, default is "") filter, choose from [line, photo, clipart, gif, transparent]
+`verbose` : (optional, default is True) Enable downloaded message.
+ + +You can also test the programm by runnning `test.py keyword` + + +### PyPi
+https://pypi.org/project/bing-image-downloader/ + + + + +
+ +### Donate +You can buy me a coffee if this project was helpful to you.
+ +[Show your support](https://www.buymeacoffee.com/gurugaurav) + + + + + + diff --git a/bing_image_downloader.egg-info/SOURCES.txt b/bing_image_downloader.egg-info/SOURCES.txt new file mode 100644 index 0000000..902848d --- /dev/null +++ b/bing_image_downloader.egg-info/SOURCES.txt @@ -0,0 +1,11 @@ +LICENSE +README.md +setup.cfg +setup.py +bing_image_downloader/__init__.py +bing_image_downloader/bing.py +bing_image_downloader/downloader.py +bing_image_downloader.egg-info/PKG-INFO +bing_image_downloader.egg-info/SOURCES.txt +bing_image_downloader.egg-info/dependency_links.txt +bing_image_downloader.egg-info/top_level.txt \ No newline at end of file diff --git a/bing_image_downloader.egg-info/dependency_links.txt b/bing_image_downloader.egg-info/dependency_links.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/bing_image_downloader.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/bing_image_downloader.egg-info/top_level.txt b/bing_image_downloader.egg-info/top_level.txt new file mode 100644 index 0000000..a10aff0 --- /dev/null +++ b/bing_image_downloader.egg-info/top_level.txt @@ -0,0 +1 @@ +bing_image_downloader diff --git a/bing_image_downloader/bing.py b/bing_image_downloader/bing.py index 4156678..cacb8ec 100644 --- a/bing_image_downloader/bing.py +++ b/bing_image_downloader/bing.py @@ -4,6 +4,8 @@ import imghdr import posixpath import re +from resize.resize import resize +from resize.resize import image_to_byte_array ''' Python api to download image form Bing. @@ -12,7 +14,7 @@ class Bing: - def __init__(self, query, limit, output_dir, adult, timeout, filter='', verbose=True): + def __init__(self, query, limit, output_dir, adult, timeout, filter='',resize=None, verbose=True): self.download_count = 0 self.query = query self.output_dir = output_dir @@ -20,11 +22,14 @@ def __init__(self, query, limit, output_dir, adult, timeout, filter='', verbose self.filter = filter self.verbose = verbose self.seen = set() + assert type(limit) == int, "limit must be integer" self.limit = limit assert type(timeout) == int, "timeout must be integer" self.timeout = timeout + assert type(resize)==tuple, "resize must be a tuple(height,width)" + self.resize=resize # self.headers = {'User-Agent': 'Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0'} self.page_counter = 0 @@ -54,16 +59,30 @@ def get_filter(self, shorthand): def save_image(self, link, file_path): - request = urllib.request.Request(link, None, self.headers) - image = urllib.request.urlopen(request, timeout=self.timeout).read() - if not imghdr.what(None, image): - print('[Error]Invalid image, not saving {}\n'.format(link)) - raise ValueError('Invalid image, not saving {}\n'.format(link)) - with open(str(file_path), 'wb') as f: - f.write(image) + if not self.resize: - + request = urllib.request.Request(link, None, self.headers) + image = urllib.request.urlopen(request, timeout=self.timeout).read() + if not imghdr.what(None, image): + print('[Error]Invalid image, not saving {}\n'.format(link)) + raise ValueError('Invalid image, not saving {}\n'.format(link)) + with open(str(file_path), 'wb') as f: + f.write(image) + elif self.resize: + request = urllib.request.Request(link, None, self.headers) + + img=resize(request,size=self.resize) + image=image_to_byte_array(img) + # if not imghdr.what(None, image): + # print('[Error]Invalid image, not saving {}\n'.format(link)) + # raise ValueError('Invalid image, not saving {}\n'.format(link)) + with open(str(file_path), 'wb') as f: + f.write(image) + + + def download_image(self, link): + self.download_count += 1 # Get the image link try: diff --git a/bing_image_downloader/downloader.py b/bing_image_downloader/downloader.py index 41789dd..3fcf469 100644 --- a/bing_image_downloader/downloader.py +++ b/bing_image_downloader/downloader.py @@ -9,7 +9,7 @@ def download(query, limit=100, output_dir='dataset', adult_filter_off=True, -force_replace=False, timeout=60, filter="", verbose=True): +force_replace=False, timeout=60, filter="",resize=None, verbose=True): # engine = 'bing' if adult_filter_off: @@ -34,7 +34,7 @@ def download(query, limit=100, output_dir='dataset', adult_filter_off=True, sys.exit(1) print("[%] Downloading Images to {}".format(str(image_dir.absolute()))) - bing = Bing(query, limit, image_dir, adult, timeout, filter, verbose) + bing = Bing(query, limit, image_dir, adult, timeout, filter,resize, verbose) bing.run() diff --git a/resize/__init__.py b/resize/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/resize/resize.py b/resize/resize.py new file mode 100644 index 0000000..4dbe94a --- /dev/null +++ b/resize/resize.py @@ -0,0 +1,23 @@ +from PIL import Image +import urllib.request +from io import BytesIO +import io + +def image_to_byte_array(image: Image) -> bytes: + imgByteArr = io.BytesIO() + image.save(imgByteArr, format="PNG") + imgByteArr = imgByteArr.getvalue() + return imgByteArr + + + + +def resize(url,size: tuple): + + response = urllib.request.urlopen(url) + img = Image.open(BytesIO(response.read())) + img=img.resize(size=size,resample=Image.LANCZOS) + #kl=image_to_byte_array(img) + # with open('pn.png','wb') as f: + # f.write(kl) + return img \ No newline at end of file From dd2fcd39c5ad0de0ee374cffd9a3cbba590a1f38 Mon Sep 17 00:00:00 2001 From: Nitesh kumar Gupta Date: Tue, 3 May 2022 19:36:19 +0530 Subject: [PATCH 2/4] ignore file updated --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 878c5ec..168e8fc 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ dataset dist image_search.egg-info **/.vscode/* -bing_image_downloader.egg-info/ \ No newline at end of file +bing_image_downloader.egg-info \ No newline at end of file From 118776f5302948f0f2ed1bcc2ee9c2c2fc858b01 Mon Sep 17 00:00:00 2001 From: Nitesh kumar Gupta Date: Tue, 3 May 2022 19:38:42 +0530 Subject: [PATCH 3/4] egg-info directory removed --- bing_image_downloader.egg-info/PKG-INFO | 82 ------------------- bing_image_downloader.egg-info/SOURCES.txt | 11 --- .../dependency_links.txt | 1 - bing_image_downloader.egg-info/top_level.txt | 1 - 4 files changed, 95 deletions(-) delete mode 100644 bing_image_downloader.egg-info/PKG-INFO delete mode 100644 bing_image_downloader.egg-info/SOURCES.txt delete mode 100644 bing_image_downloader.egg-info/dependency_links.txt delete mode 100644 bing_image_downloader.egg-info/top_level.txt diff --git a/bing_image_downloader.egg-info/PKG-INFO b/bing_image_downloader.egg-info/PKG-INFO deleted file mode 100644 index eba6059..0000000 --- a/bing_image_downloader.egg-info/PKG-INFO +++ /dev/null @@ -1,82 +0,0 @@ -Metadata-Version: 2.1 -Name: bing-image-downloader -Version: 1.1.2 -Summary: Python library to download bulk images from Bing.com -Home-page: https://github.com/gurugaurav/bing_image_downloader -Author: Guru Prasad Singh -Author-email: g.gaurav541@gmail.com -License: UNKNOWN -Keywords: bing,images,scraping,image download,bulk image downloader -Platform: UNKNOWN -Classifier: Programming Language :: Python :: 3 -Classifier: License :: OSI Approved :: MIT License -Classifier: Operating System :: OS Independent -Description-Content-Type: text/markdown -License-File: LICENSE - -![GitHub top language](https://img.shields.io/github/languages/top/gurugaurav/bing_image_downloader) -![GitHub](https://img.shields.io/github/license/gurugaurav/bing_image_downloader) -[![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fgurugaurav%2Fbing_image_downloader&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false)](https://hits.seeyoufarm.com) -## Bing Image Downloader -
- -Python library to download bulk of images form Bing.com. -This package uses async url, which makes it very fast while downloading.
- - -### Disclaimer
- -This program lets you download tons of images from Bing. -Please do not download or use any image that violates its copyright terms. - -### Installation
-```sh -pip install bing-image-downloader -``` - -or -```bash -git clone https://github.com/gurugaurav/bing_image_downloader -cd bing_image_downloader -pip install . -``` - - - -### Usage
-```python -from bing_image_downloader import downloader -downloader.download(query_string, limit=100, output_dir='dataset', adult_filter_off=True, force_replace=False, timeout=60, verbose=True) -``` - -`query_string` : String to be searched.
-`limit` : (optional, default is 100) Number of images to download.
-`output_dir` : (optional, default is 'dataset') Name of output dir.
-`adult_filter_off` : (optional, default is True) Enable of disable adult filteration.
-`force_replace` : (optional, default is False) Delete folder if present and start a fresh download.
-`timeout` : (optional, default is 60) timeout for connection in seconds.
-`filter` : (optional, default is "") filter, choose from [line, photo, clipart, gif, transparent]
-`verbose` : (optional, default is True) Enable downloaded message.
- - -You can also test the programm by runnning `test.py keyword` - - -### PyPi
-https://pypi.org/project/bing-image-downloader/ - - - - -
- -### Donate -You can buy me a coffee if this project was helpful to you.
- -[Show your support](https://www.buymeacoffee.com/gurugaurav) - - - - - - diff --git a/bing_image_downloader.egg-info/SOURCES.txt b/bing_image_downloader.egg-info/SOURCES.txt deleted file mode 100644 index 902848d..0000000 --- a/bing_image_downloader.egg-info/SOURCES.txt +++ /dev/null @@ -1,11 +0,0 @@ -LICENSE -README.md -setup.cfg -setup.py -bing_image_downloader/__init__.py -bing_image_downloader/bing.py -bing_image_downloader/downloader.py -bing_image_downloader.egg-info/PKG-INFO -bing_image_downloader.egg-info/SOURCES.txt -bing_image_downloader.egg-info/dependency_links.txt -bing_image_downloader.egg-info/top_level.txt \ No newline at end of file diff --git a/bing_image_downloader.egg-info/dependency_links.txt b/bing_image_downloader.egg-info/dependency_links.txt deleted file mode 100644 index 8b13789..0000000 --- a/bing_image_downloader.egg-info/dependency_links.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/bing_image_downloader.egg-info/top_level.txt b/bing_image_downloader.egg-info/top_level.txt deleted file mode 100644 index a10aff0..0000000 --- a/bing_image_downloader.egg-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -bing_image_downloader From 0153d4d18252645d22d5504bda18ebce5bc34f12 Mon Sep 17 00:00:00 2001 From: Nitesh kumar Gupta Date: Tue, 3 May 2022 21:34:23 +0530 Subject: [PATCH 4/4] merged the resize folder with bing module --- bing_image_downloader/bing.py | 25 ++- requirements.txt | 387 ++++++++++++++++++++++++++++++++++ resize/__init__.py | 0 resize/resize.py | 23 -- 4 files changed, 408 insertions(+), 27 deletions(-) delete mode 100644 resize/__init__.py delete mode 100644 resize/resize.py diff --git a/bing_image_downloader/bing.py b/bing_image_downloader/bing.py index cacb8ec..39f5633 100644 --- a/bing_image_downloader/bing.py +++ b/bing_image_downloader/bing.py @@ -4,14 +4,31 @@ import imghdr import posixpath import re -from resize.resize import resize -from resize.resize import image_to_byte_array +from PIL import Image +from io import BytesIO +import io + ''' Python api to download image form Bing. Author: Guru Prasad (g.gaurav541@gmail.com) ''' - +def image_to_byte_array(image: Image) -> bytes: + imgByteArr = io.BytesIO() + image.save(imgByteArr, format="PNG") + imgByteArr = imgByteArr.getvalue() + return imgByteArr + + +def resize(url,size: tuple): + + response = urllib.request.urlopen(url) + img = Image.open(BytesIO(response.read())) + img=img.resize(size=size,resample=Image.LANCZOS) + #kl=image_to_byte_array(img) + # with open('pn.png','wb') as f: + # f.write(kl) + return img class Bing: def __init__(self, query, limit, output_dir, adult, timeout, filter='',resize=None, verbose=True): @@ -28,7 +45,7 @@ def __init__(self, query, limit, output_dir, adult, timeout, filter='',resize=No self.limit = limit assert type(timeout) == int, "timeout must be integer" self.timeout = timeout - assert type(resize)==tuple, "resize must be a tuple(height,width)" + assert (type(resize)==tuple) or (resize is None), "resize must be a tuple(height,width)" self.resize=resize # self.headers = {'User-Agent': 'Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0'} diff --git a/requirements.txt b/requirements.txt index e69de29..14954e4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -0,0 +1,387 @@ +absl-py==1.0.0 +aiohttp==3.8.1 +aiohttp-retry==2.4.6 +aiosignal==1.2.0 +alabaster @ file:///home/ktietz/src/ci/alabaster_1611921544520/work +anaconda-client @ file:///C:/ci/anaconda-client_1635342725944/work +anaconda-navigator==2.1.1 +anaconda-project @ file:///tmp/build/80754af9/anaconda-project_1626085644852/work +anyio @ file:///C:/ci/anyio_1620153135622/work/dist +appdirs==1.4.4 +argh==0.26.2 +argon2-cffi @ file:///C:/ci/argon2-cffi_1613037869401/work +arrow @ file:///C:/ci/arrow_1617738834352/work +asn1crypto @ file:///tmp/build/80754af9/asn1crypto_1596577642040/work +astroid @ file:///C:/ci/astroid_1628063282661/work +astropy @ file:///C:/ci/astropy_1629829318700/work +astunparse==1.6.3 +async-generator @ file:///home/ktietz/src/ci/async_generator_1611927993394/work +async-timeout==4.0.2 +asyncssh==2.10.1 +atomicwrites==1.4.0 +atpublic==3.0.1 +attrs @ file:///tmp/build/80754af9/attrs_1620827162558/work +autopep8 @ file:///tmp/build/80754af9/autopep8_1620866417880/work +Babel @ file:///tmp/build/80754af9/babel_1620871417480/work +backcall @ file:///home/ktietz/src/ci/backcall_1611930011877/work +backports.functools-lru-cache @ file:///tmp/build/80754af9/backports.functools_lru_cache_1618170165463/work +backports.shutil-get-terminal-size @ file:///tmp/build/80754af9/backports.shutil_get_terminal_size_1608222128777/work +backports.tempfile @ file:///home/linux1/recipes/ci/backports.tempfile_1610991236607/work +backports.weakref==1.0.post1 +bcrypt @ file:///C:/ci/bcrypt_1607022693089/work +beautifulsoup4 @ file:///tmp/build/80754af9/beautifulsoup4_1631874778482/work +binaryornot @ file:///tmp/build/80754af9/binaryornot_1617751525010/work +bing-image-downloader==1.1.2 +bitarray @ file:///C:/ci/bitarray_1629133068652/work +bkcharts==0.2 +black==19.10b0 +bleach @ file:///tmp/build/80754af9/bleach_1628110601003/work +bokeh @ file:///C:/ci/bokeh_1635306491714/work +boto==2.49.0 +boto3==1.22.4 +botocore==1.25.4 +Bottleneck @ file:///C:/ci/bottleneck_1607557040328/work +brotlipy==0.7.0 +cached-property @ file:///tmp/build/80754af9/cached-property_1600785575025/work +cachetools==5.0.0 +cassandra-driver==3.25.0 +certifi==2021.10.8 +cffi @ file:///C:/ci/cffi_1625831756778/work +chardet @ file:///C:/ci/chardet_1607706937985/work +charset-normalizer @ file:///tmp/build/80754af9/charset-normalizer_1630003229654/work +click==8.0.3 +cloudpickle @ file:///tmp/build/80754af9/cloudpickle_1632508026186/work +clyent==1.2.2 +colorama @ file:///tmp/build/80754af9/colorama_1607707115595/work +commonmark==0.9.1 +comtypes==1.1.10 +conda==4.10.3 +conda-build==3.21.6 +conda-content-trust @ file:///tmp/build/80754af9/conda-content-trust_1617045594566/work +conda-pack @ file:///tmp/build/80754af9/conda-pack_1611163042455/work +conda-package-handling @ file:///C:/ci/conda-package-handling_1618262410900/work +conda-repo-cli @ file:///tmp/build/80754af9/conda-repo-cli_1620168426516/work +conda-token @ file:///tmp/build/80754af9/conda-token_1620076980546/work +conda-verify==3.4.2 +configobj==5.0.6 +contextlib2 @ file:///Users/ktietz/demo/mc3/conda-bld/contextlib2_1630668244042/work +cookiecutter @ file:///tmp/build/80754af9/cookiecutter_1617748928239/work +cryptography @ file:///C:/ci/cryptography_1633520531101/work +cycler==0.10.0 +Cython @ file:///C:/ci/cython_1636018292912/work +cytoolz==0.11.0 +daal4py==2021.3.0 +dask==2021.10.0 +debugpy @ file:///C:/ci/debugpy_1629222819322/work +decorator @ file:///tmp/build/80754af9/decorator_1632776554403/work +defusedxml @ file:///tmp/build/80754af9/defusedxml_1615228127516/work +dictdiffer==0.9.0 +diff-match-patch @ file:///Users/ktietz/demo/mc3/conda-bld/diff-match-patch_1630511840874/work +diskcache==5.4.0 +distlib==0.3.4 +distributed @ file:///C:/ci/distributed_1635968318313/work +distro==1.7.0 +dnspython==2.2.0 +docutils @ file:///C:/ci/docutils_1620828264669/work +dpath==2.0.6 +dulwich==0.20.35 +dvc==2.10.2 +dvc-render==0.0.5 +dvclive==0.7.3 +entrypoints==0.3 +et-xmlfile==1.1.0 +fastcache @ file:///C:/ci/fastcache_1607571310570/work +filelock @ file:///tmp/build/80754af9/filelock_1635402558181/work +flake8 @ file:///tmp/build/80754af9/flake8_1620776156532/work +Flask @ file:///home/ktietz/src/ci/flask_1611932660458/work +flatbuffers==2.0 +flatten-dict==0.4.2 +flufl.lock==7.0 +fonttools==4.25.0 +frozenlist==1.3.0 +fsspec @ file:///tmp/build/80754af9/fsspec_1636116461911/work +ftfy==6.1.1 +funcy==1.17 +future @ file:///C:/ci/future_1607568713721/work +gast==0.5.3 +geomet==0.2.1.post1 +gevent @ file:///C:/ci/gevent_1628273776273/work +gitdb==4.0.9 +GitPython==3.1.27 +glob2 @ file:///home/linux1/recipes/ci/glob2_1610991677669/work +google-auth==2.6.6 +google-auth-oauthlib==0.4.6 +google-pasta==0.2.0 +grandalf==0.6 +greenlet @ file:///C:/ci/greenlet_1628888275363/work +grpcio==1.44.0 +h5py @ file:///C:/ci/h5py_1622088609188/work +HeapDict @ file:///Users/ktietz/demo/mc3/conda-bld/heapdict_1630598515714/work +html5lib @ file:///Users/ktietz/demo/mc3/conda-bld/html5lib_1629144453894/work +htmlmin==0.1.12 +idna @ file:///tmp/build/80754af9/idna_1622654382723/work +imagecodecs @ file:///C:/ci/imagecodecs_1635511087451/work +ImageHash==4.2.1 +imageio @ file:///tmp/build/80754af9/imageio_1617700267927/work +imagesize @ file:///Users/ktietz/demo/mc3/conda-bld/imagesize_1628863108022/work +importlib-metadata @ file:///C:/ci/importlib-metadata_1631916826748/work +inflection==0.5.1 +iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work +intervaltree @ file:///Users/ktietz/demo/mc3/conda-bld/intervaltree_1630511889664/work +ipykernel @ file:///C:/ci/ipykernel_1633545585502/work/dist/ipykernel-6.4.1-py3-none-any.whl +ipython @ file:///C:/ci/ipython_1635944283918/work +ipython-genutils @ file:///tmp/build/80754af9/ipython_genutils_1606773439826/work +ipywidgets @ file:///tmp/build/80754af9/ipywidgets_1634143127070/work +isort @ file:///tmp/build/80754af9/isort_1628603791788/work +itsdangerous @ file:///tmp/build/80754af9/itsdangerous_1621432558163/work +jdcal @ file:///Users/ktietz/demo/mc3/conda-bld/jdcal_1630584345063/work +jedi @ file:///C:/ci/jedi_1611341083684/work +Jinja2 @ file:///tmp/build/80754af9/jinja2_1612213139570/work +jinja2-time @ file:///tmp/build/80754af9/jinja2-time_1617751524098/work +jmespath==1.0.0 +joblib==1.0.1 +json5 @ file:///tmp/build/80754af9/json5_1624432770122/work +jsonschema @ file:///Users/ktietz/demo/mc3/conda-bld/jsonschema_1630511932244/work +jupyter @ file:///C:/ci/jupyter_1607685287094/work +jupyter-client @ file:///tmp/build/80754af9/jupyter_client_1616770841739/work +jupyter-console @ file:///tmp/build/80754af9/jupyter_console_1616615302928/work +jupyter-core @ file:///C:/ci/jupyter_core_1633420716440/work +jupyter-server @ file:///C:/ci/jupyter_server_1616084298419/work +jupyterlab @ file:///tmp/build/80754af9/jupyterlab_1635799997693/work +jupyterlab-pygments @ file:///tmp/build/80754af9/jupyterlab_pygments_1601490720602/work +jupyterlab-server @ file:///tmp/build/80754af9/jupyterlab_server_1633419203660/work +jupyterlab-widgets @ file:///tmp/build/80754af9/jupyterlab_widgets_1609884341231/work +keras==2.8.0 +Keras-Preprocessing==1.1.2 +keyring @ file:///C:/ci/keyring_1629321702436/work +Kivy==2.0.0 +kivy-deps.angle==0.3.1 +kivy-deps.glew==0.3.0 +kivy-deps.sdl2==0.3.1 +Kivy-Garden==0.1.4 +kiwisolver @ file:///C:/ci/kiwisolver_1612282555033/work +lazy-object-proxy @ file:///C:/ci/lazy-object-proxy_1616529288960/work +libarchive-c @ file:///tmp/build/80754af9/python-libarchive-c_1617780486945/work +libclang==14.0.1 +llvmlite==0.37.0 +locket==0.2.1 +lxml @ file:///C:/ci/lxml_1616443418777/work +mailchecker==4.1.16 +Markdown==3.3.6 +MarkupSafe==2.0.1 +matplotlib @ file:///C:/ci/matplotlib-suite_1634667159685/work +matplotlib-inline @ file:///tmp/build/80754af9/matplotlib-inline_1628242447089/work +mccabe==0.6.1 +menuinst @ file:///C:/ci/menuinst_1631733438520/work +missingno==0.5.1 +mistune @ file:///C:/ci/mistune_1607359457024/work +mkl-fft==1.3.1 +mkl-random @ file:///C:/ci/mkl_random_1626186184308/work +mkl-service==2.4.0 +mock @ file:///tmp/build/80754af9/mock_1607622725907/work +more-itertools @ file:///tmp/build/80754af9/more-itertools_1635423142362/work +mpmath==1.2.1 +msgpack @ file:///C:/ci/msgpack-python_1612287350784/work +multidict==6.0.2 +multimethod==1.7 +multipledispatch @ file:///C:/ci/multipledispatch_1607574329826/work +munkres==1.1.4 +mypy-extensions==0.4.3 +mysql-connector-python==8.0.28 +nanotime==0.5.2 +navigator-updater==0.2.1 +nbclassic @ file:///tmp/build/80754af9/nbclassic_1616085367084/work +nbclient @ file:///tmp/build/80754af9/nbclient_1614364831625/work +nbconvert @ file:///C:/ci/nbconvert_1624479160025/work +nbformat @ file:///tmp/build/80754af9/nbformat_1617383369282/work +nest-asyncio @ file:///tmp/build/80754af9/nest-asyncio_1613680548246/work +networkx @ file:///tmp/build/80754af9/networkx_1633639043937/work +nltk==3.6.5 +nose @ file:///tmp/build/80754af9/nose_1606773131901/work +notebook @ file:///C:/ci/notebook_1635393701545/work +numba @ file:///C:/ci/numba_1635186062888/work +numexpr @ file:///C:/ci/numexpr_1618856728739/work +numpy @ file:///C:/ci/numpy_and_numpy_base_1626271900803/work +numpydoc @ file:///tmp/build/80754af9/numpydoc_1605117425582/work +oauthlib==3.2.0 +olefile @ file:///Users/ktietz/demo/mc3/conda-bld/olefile_1629805411829/work +openpyxl @ file:///tmp/build/80754af9/openpyxl_1632777717936/work +opt-einsum==3.3.0 +packaging @ file:///tmp/build/80754af9/packaging_1625611678980/work +pandas @ file:///C:/ci/pandas_1635506685681/work +pandas-profiling==3.1.0 +pandocfilters @ file:///C:/ci/pandocfilters_1605114832805/work +paramiko @ file:///tmp/build/80754af9/paramiko_1598886428689/work +parso @ file:///tmp/build/80754af9/parso_1617223946239/work +partd @ file:///tmp/build/80754af9/partd_1618000087440/work +path @ file:///C:/ci/path_1624287837534/work +pathlib2 @ file:///C:/ci/pathlib2_1625585796814/work +pathspec==0.9.0 +patsy==0.5.2 +pep8==1.7.1 +pexpect @ file:///tmp/build/80754af9/pexpect_1605563209008/work +phik==0.12.0 +phonenumbers==8.12.47 +pickleshare @ file:///tmp/build/80754af9/pickleshare_1606932040724/work +Pillow==8.4.0 +pkginfo==1.7.1 +platformdirs==2.5.0 +pluggy @ file:///C:/ci/pluggy_1615976440052/work +ply==3.11 +poyo @ file:///tmp/build/80754af9/poyo_1617751526755/work +prometheus-client @ file:///tmp/build/80754af9/prometheus_client_1623189609245/work +prompt-toolkit @ file:///tmp/build/80754af9/prompt-toolkit_1633440160888/work +protobuf==3.19.4 +psutil==5.9.0 +ptyprocess @ file:///tmp/build/80754af9/ptyprocess_1609355006118/work/dist/ptyprocess-0.7.0-py2.py3-none-any.whl +py @ file:///tmp/build/80754af9/py_1607971587848/work +pyasn1==0.4.8 +pyasn1-modules==0.2.8 +pycodestyle @ file:///tmp/build/80754af9/pycodestyle_1615748559966/work +pycosat==0.6.3 +pycparser @ file:///tmp/build/80754af9/pycparser_1594388511720/work +pycurl==7.44.1 +pydantic==1.9.0 +pydocstyle @ file:///tmp/build/80754af9/pydocstyle_1621600989141/work +pydot==1.4.2 +pyerfa @ file:///C:/ci/pyerfa_1621560974055/work +pyflakes @ file:///tmp/build/80754af9/pyflakes_1617200973297/work +pygit2==1.9.1 +Pygments @ file:///tmp/build/80754af9/pygments_1629234116488/work +pygtrie==2.4.2 +PyInputPlus==0.2.12 +PyJWT @ file:///C:/ci/pyjwt_1619682721924/work +pylint @ file:///C:/ci/pylint_1627536884966/work +pyls-spyder==0.4.0 +pymongo==4.0.1 +PyNaCl @ file:///C:/ci/pynacl_1607612759007/work +pyodbc===4.0.0-unsupported +pyOpenSSL @ file:///tmp/build/80754af9/pyopenssl_1635333100036/work +pyparsing @ file:///tmp/build/80754af9/pyparsing_1635766073266/work +pypiwin32==223 +pyreadline==2.1 +pyrsistent @ file:///C:/ci/pyrsistent_1636093225342/work +PySimpleValidate==0.2.12 +PySocks @ file:///C:/ci/pysocks_1605307512533/work +pytest==6.2.4 +python-benedict==0.25.1 +python-dateutil @ file:///tmp/build/80754af9/python-dateutil_1626374649649/work +python-fsutil==0.6.0 +python-lsp-black @ file:///tmp/build/80754af9/python-lsp-black_1634232156041/work +python-lsp-jsonrpc==1.0.0 +python-lsp-server==1.2.4 +python-slugify==6.1.2 +pytz==2021.3 +PyWavelets @ file:///C:/ci/pywavelets_1607645631519/work +pywin32==228 +pywin32-ctypes @ file:///C:/ci/pywin32-ctypes_1607553594546/work +pywinpty @ file:///C:/ci/pywinpty_1607419945780/work +PyYAML==6.0 +pyzmq @ file:///C:/ci/pyzmq_1628276105793/work +QDarkStyle @ file:///tmp/build/80754af9/qdarkstyle_1617386714626/work +qstylizer @ file:///tmp/build/80754af9/qstylizer_1617713584600/work/dist/qstylizer-0.1.10-py2.py3-none-any.whl +QtAwesome @ file:///tmp/build/80754af9/qtawesome_1615991616277/work +qtconsole @ file:///tmp/build/80754af9/qtconsole_1632739723211/work +QtPy @ file:///tmp/build/80754af9/qtpy_1629397026935/work +regex @ file:///C:/ci/regex_1628063427816/work +requests @ file:///tmp/build/80754af9/requests_1629994808627/work +requests-oauthlib==1.3.1 +rich==12.3.0 +rope @ file:///tmp/build/80754af9/rope_1623703006312/work +rsa==4.8 +Rtree @ file:///C:/ci/rtree_1618421015405/work +ruamel-yaml-conda @ file:///C:/ci/ruamel_yaml_1616016898638/work +ruamel.yaml==0.17.21 +ruamel.yaml.clib==0.2.6 +s3transfer==0.5.2 +scikit-image==0.18.3 +scikit-learn @ file:///C:/ci/scikit-learn_1622739499047/work +scikit-learn-intelex==2021.20210714.120553 +scipy @ file:///C:/ci/scipy_1630606917240/work +scmrepo==0.0.19 +seaborn @ file:///tmp/build/80754af9/seaborn_1629307859561/work +Send2Trash @ file:///tmp/build/80754af9/send2trash_1632406701022/work +shortuuid==1.0.8 +shtab==1.5.4 +simplegeneric==0.8.1 +simplejson==3.17.6 +singledispatch @ file:///tmp/build/80754af9/singledispatch_1629321204894/work +sip==4.19.13 +six @ file:///tmp/build/80754af9/six_1623709665295/work +smmap==5.0.0 +sniffio @ file:///C:/ci/sniffio_1614030527509/work +snowballstemmer @ file:///tmp/build/80754af9/snowballstemmer_1611258885636/work +sortedcollections @ file:///tmp/build/80754af9/sortedcollections_1611172717284/work +sortedcontainers @ file:///tmp/build/80754af9/sortedcontainers_1623949099177/work +soupsieve @ file:///tmp/build/80754af9/soupsieve_1616183228191/work +Sphinx==4.2.0 +sphinxcontrib-applehelp @ file:///home/ktietz/src/ci/sphinxcontrib-applehelp_1611920841464/work +sphinxcontrib-devhelp @ file:///home/ktietz/src/ci/sphinxcontrib-devhelp_1611920923094/work +sphinxcontrib-htmlhelp @ file:///tmp/build/80754af9/sphinxcontrib-htmlhelp_1623945626792/work +sphinxcontrib-jsmath @ file:///home/ktietz/src/ci/sphinxcontrib-jsmath_1611920942228/work +sphinxcontrib-qthelp @ file:///home/ktietz/src/ci/sphinxcontrib-qthelp_1611921055322/work +sphinxcontrib-serializinghtml @ file:///tmp/build/80754af9/sphinxcontrib-serializinghtml_1624451540180/work +sphinxcontrib-websupport @ file:///tmp/build/80754af9/sphinxcontrib-websupport_1597081412696/work +spyder @ file:///C:/ci/spyder_1636480369575/work +spyder-kernels @ file:///C:/ci/spyder-kernels_1634237096710/work +SQLAlchemy @ file:///C:/ci/sqlalchemy_1626948551162/work +statsmodels==0.12.2 +stdiomask==0.0.6 +sympy @ file:///C:/ci/sympy_1635219088507/work +tables==3.6.1 +tabulate==0.8.9 +tangled-up-in-unicode==0.1.0 +TBB==0.2 +tblib @ file:///Users/ktietz/demo/mc3/conda-bld/tblib_1629402031467/work +tensorboard==2.8.0 +tensorboard-data-server==0.6.1 +tensorboard-plugin-wit==1.8.1 +tensorflow==2.8.0 +tensorflow-io-gcs-filesystem==0.25.0 +termcolor==1.1.0 +terminado==0.9.4 +testpath @ file:///tmp/build/80754af9/testpath_1624638946665/work +text-unidecode @ file:///Users/ktietz/demo/mc3/conda-bld/text-unidecode_1629401354553/work +textdistance @ file:///tmp/build/80754af9/textdistance_1612461398012/work +tf-estimator-nightly==2.8.0.dev2021122109 +threadpoolctl @ file:///Users/ktietz/demo/mc3/conda-bld/threadpoolctl_1629802263681/work +three-merge @ file:///tmp/build/80754af9/three-merge_1607553261110/work +tifffile @ file:///tmp/build/80754af9/tifffile_1627275862826/work +tinycss @ file:///tmp/build/80754af9/tinycss_1617713798712/work +toml @ file:///tmp/build/80754af9/toml_1616166611790/work +toolz @ file:///home/linux1/recipes/ci/toolz_1610987900194/work +tornado @ file:///C:/ci/tornado_1606924294691/work +tqdm==4.64.0 +traitlets @ file:///tmp/build/80754af9/traitlets_1632522747050/work +typed-ast @ file:///C:/ci/typed-ast_1624953797214/work +typing-extensions @ file:///tmp/build/80754af9/typing_extensions_1631814937681/work +ujson @ file:///C:/ci/ujson_1611259568517/work +unicodecsv==0.14.1 +Unidecode @ file:///tmp/build/80754af9/unidecode_1614712377438/work +urllib3==1.26.7 +virtualenv==20.13.1 +visions==0.7.4 +voluptuous==0.13.1 +watchdog @ file:///C:/ci/watchdog_1624955113064/work +wcwidth @ file:///Users/ktietz/demo/mc3/conda-bld/wcwidth_1629357192024/work +webencodings==0.5.1 +Werkzeug @ file:///tmp/build/80754af9/werkzeug_1635505089296/work +wget==3.2 +whichcraft @ file:///tmp/build/80754af9/whichcraft_1617751293875/work +widgetsnbextension @ file:///C:/ci/widgetsnbextension_1607531582688/work +win-inet-pton @ file:///C:/ci/win_inet_pton_1605306162074/work +win-unicode-console==0.5 +wincertstore==0.2 +wrapt @ file:///C:/ci/wrapt_1607574570428/work +xlrd @ file:///tmp/build/80754af9/xlrd_1608072521494/work +XlsxWriter @ file:///tmp/build/80754af9/xlsxwriter_1628603415431/work +xlwings==0.24.9 +xlwt==1.3.0 +xmltodict @ file:///Users/ktietz/demo/mc3/conda-bld/xmltodict_1629301980723/work +yapf @ file:///tmp/build/80754af9/yapf_1615749224965/work +yarl==1.7.2 +zc.lockfile==2.0 +zict==2.0.0 +zipp @ file:///tmp/build/80754af9/zipp_1633618647012/work +zope.event==4.5.0 +zope.interface @ file:///C:/ci/zope.interface_1625036252485/work diff --git a/resize/__init__.py b/resize/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/resize/resize.py b/resize/resize.py deleted file mode 100644 index 4dbe94a..0000000 --- a/resize/resize.py +++ /dev/null @@ -1,23 +0,0 @@ -from PIL import Image -import urllib.request -from io import BytesIO -import io - -def image_to_byte_array(image: Image) -> bytes: - imgByteArr = io.BytesIO() - image.save(imgByteArr, format="PNG") - imgByteArr = imgByteArr.getvalue() - return imgByteArr - - - - -def resize(url,size: tuple): - - response = urllib.request.urlopen(url) - img = Image.open(BytesIO(response.read())) - img=img.resize(size=size,resample=Image.LANCZOS) - #kl=image_to_byte_array(img) - # with open('pn.png','wb') as f: - # f.write(kl) - return img \ No newline at end of file