Skip to content
Snippets Groups Projects
Commit d38c4333 authored by Shawaz Shah's avatar Shawaz Shah
Browse files

Init repo

parents
No related branches found
No related tags found
No related merge requests found
Showing
with 119 additions and 0 deletions
input/downloads/login_button/80.de40dbb60c057de66a1b2e2c98d15068.jpg

105 KiB

input/downloads/login_button/81.social_login_button_02.jpg

17.1 KiB

input/downloads/login_button/82.login-button-icon-25.jpg

12.8 KiB

input/downloads/login_button/83.facebook_login.png

67.9 KiB

input/downloads/login_button/85.49004709-e2580400-f18a-11e8-93c3-e3642f83854e.png

171 KiB

input/downloads/login_button/86.memories-vk-social-login-form.png

4.24 KiB

input/downloads/login_button/88.1*hpKQ1q8LWEgzRmxTKQ3mRQ.png

91.6 KiB

input/downloads/login_button/89.login-button-stock-illustration-1691956.jpg

111 KiB

input/downloads/login_button/90.1000_F_42580053_4XY6g3TWqyjavYBPbigXRbrVdhoXDVS7.jpg

64.4 KiB

input/downloads/login_button/91.ENID-300x193.jpg

7.3 KiB

input/downloads/login_button/92.80c6b851e37f89d1409876629f2dee25a231d4c3.jpg

95 KiB

input/downloads/login_button/93.Captura-2.png

82.1 KiB

File added
{
"cells": [],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 2
}
%% Cell type:code id: tags:
``` python
from typing import List
def init():
pass
```
%% Cell type:code id: tags:
``` python
def get_url(url: List[str]):
import os
return os.path.join(os.getcwd(), *url)
```
%% Cell type:code id: tags:
``` python
def get_images_by_keywords(keywords: List[str], limit: int):
from google_images_download import google_images_download
response = google_images_download.googleimagesdownload()
arguments = {
"keywords": ",".join(keywords),
"limit": limit,
"print_urls":True
}
paths = response.download(arguments)
def apply_augmentation(path_input_login):
import Augmentor
p = Augmentor.Pipeline(path_input_login)
p.rotate(probability=1, max_left_rotation=5, max_right_rotation=5)
p.flip_left_right(probability=0.5)
p.zoom_random(probability=0.5, percentage_area=0.8)
p.flip_top_bottom(probability=0.5)
p.sample(50)
p.process()
# get_images_by_keywords(["login_button"], 100)
path_input_login = get_url(["..", "input", "downloads", "login_button"])
apply_augmentation(path_input_login)
```
%% Output
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
/usr/local/lib/python3.7/site-packages/Augmentor/Pipeline.py in _check_images(self, abs_output_directory)
185 try:
--> 186 with Image.open(augmentor_image.image_path) as opened_image:
187 self.distinct_dimensions.add(opened_image.size)
/usr/local/lib/python3.7/site-packages/PIL/Image.py in open(fp, mode)
2704 raise IOError("cannot identify image file %r"
-> 2705 % (filename if filename else fp))
2706
OSError: cannot identify image file '/Users/shawaiz/projects/obj-dtct/input/downloads/login_button/33.login-button-png-2.png'
During handling of the above exception, another exception occurred:
AttributeError Traceback (most recent call last)
<ipython-input-63-68dccb47df0e> in <module>
26
27 path_input_login = get_url(["..", "input", "downloads", "login_button"])
---> 28 apply_augmentation(path_input_login)
<ipython-input-63-68dccb47df0e> in apply_augmentation(path_input_login)
15 import Augmentor
16
---> 17 p = Augmentor.Pipeline(path_input_login)
18 p.rotate(probability=1, max_left_rotation=5, max_right_rotation=5)
19 p.flip_left_right(probability=0.5)
/usr/local/lib/python3.7/site-packages/Augmentor/Pipeline.py in __init__(self, source_directory, output_directory, save_format)
88 output_directory=output_directory,
89 ground_truth_directory=None,
---> 90 ground_truth_output_directory=output_directory)
91
92 def __call__(self, augmentor_image):
/usr/local/lib/python3.7/site-packages/Augmentor/Pipeline.py in _populate(self, source_directory, output_directory, ground_truth_directory, ground_truth_output_directory)
146 self.augmentor_images, self.class_labels = scan(source_directory, abs_output_directory)
147
--> 148 self._check_images(abs_output_directory)
149
150 def _populate_image_arrays(self):
/usr/local/lib/python3.7/site-packages/Augmentor/Pipeline.py in _check_images(self, abs_output_directory)
189 except IOError as e:
190 print("There is a problem with image %s in your source directory: %s"
--> 191 % (augmentor_image.image_path, e.message))
192 self.augmentor_images.remove(augmentor_image)
193
AttributeError: 'OSError' object has no attribute 'message'
%% Cell type:code id: tags:
``` python
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment