All Projects → deliton → Idt

deliton / Idt

Licence: mit
Image Dataset Tool (idt) is a cli tool designed to make the otherwise repetitive and slow task of creating image datasets into a fast and intuitive process.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Idt

Search Engine Parser
Lightweight package to query popular search engines and scrape for result titles, links and descriptions
Stars: ✭ 216 (+6.93%)
Mutual labels:  bing, search-engine, scraping
Googlescraper
A Python module to scrape several search engines (like Google, Yandex, Bing, Duckduckgo, ...). Including asynchronous networking support.
Stars: ✭ 2,363 (+1069.8%)
Mutual labels:  search-engine, scraping
bing-ip2hosts
bingip2hosts is a Bing.com web scraper that discovers websites by IP address
Stars: ✭ 99 (-50.99%)
Mutual labels:  search-engine, bing
awesome-search-engine-optimization
A curated list of backlink, social signal opportunities, and link building strategies and tactics to help improve search engine results and ranking.
Stars: ✭ 82 (-59.41%)
Mutual labels:  search-engine, bing
Downloadsearch
search for any kinds of files to download
Stars: ✭ 124 (-38.61%)
Mutual labels:  search-engine, download
Xinahn Socket
一个开源,高隐私,自架自用的聚合搜索引擎。 https://xinahn.com
Stars: ✭ 77 (-61.88%)
Mutual labels:  bing, search-engine
gamesearch
A Simple Search Engine to help you find FREE Download Links to your Favourite Games
Stars: ✭ 30 (-85.15%)
Mutual labels:  search-engine, download
Bulk Bing Image Downloader
Download full sized images returned from bing image search
Stars: ✭ 271 (+34.16%)
Mutual labels:  bing, download
Geeksforgeeks.pdf
Topic wise PDFs of Geeks for Geeks articles. (Last updated in October 2018)
Stars: ✭ 489 (+142.08%)
Mutual labels:  scraping, download
Languagepod101 Scraper
Python scraper for Language Pods such as Japanesepod101.com 👹 🗾 🍣 Compatible with Japanese, Chinese, French, German, Italian, Korean, Portuguese, Russian, Spanish and many more! ✨
Stars: ✭ 104 (-48.51%)
Mutual labels:  scraping, download
Search Engine Google
🕷 Google client for SERPS
Stars: ✭ 138 (-31.68%)
Mutual labels:  search-engine, scraping
Downloader
Powerful and flexible Android file downloader
Stars: ✭ 193 (-4.46%)
Mutual labels:  download
Meilisearch
Powerful, fast, and an easy to use search engine
Stars: ✭ 20,236 (+9917.82%)
Mutual labels:  search-engine
Pyload
The free and open-source Download Manager written in pure Python
Stars: ✭ 2,393 (+1084.65%)
Mutual labels:  download
Mahuta
IPFS Storage service with search capability
Stars: ✭ 185 (-8.42%)
Mutual labels:  search-engine
Jsonframe Cheerio
simple multi-level scraper json input/output for Cheerio
Stars: ✭ 196 (-2.97%)
Mutual labels:  scraping
Jsearch
jSearch(聚搜) 是一款专注内容的chrome搜索扩展,一次搜索聚合多平台内容。
Stars: ✭ 193 (-4.46%)
Mutual labels:  bing
Airanime
轻量化动漫聚合搜索工具
Stars: ✭ 184 (-8.91%)
Mutual labels:  search-engine
Youtube Downloader For Macos
Simple menu bar app to download YouTube movies on your Mac
Stars: ✭ 185 (-8.42%)
Mutual labels:  download
Principle Of Web Search
北京邮电大学“网络搜索原理”课程资料(2019)
Stars: ✭ 182 (-9.9%)
Mutual labels:  search-engine

IDT - Image Dataset Tool

Version 0.0.6 beta

idt-logo

Description

The image dataset tool (IDT) is a CLI app developed to make it easier and faster to create image datasets to be used for deep learning. The tool achieves this by scraping images from several search engines such as duckgo, bing and deviantart. IDT also optimizes the image dataset, although this feature is optional, the user can downscale and compress the images for optimal file size and dimensions. A sample dataset created using idt that contains a total amount of 23.688 image files weights only 559,2 megabytes.

NEW UPDATE!

I am proud to announce our newest version! 🎉🎉

What changed

  • Added auto duplicate images remover
  • Added longer side resize method. With this option, the image is resized to its longer side.
  • Added shorter side resize method. With this option, the image is resized to its shorter side.
  • Added Smart Crop. This method tries to crop and resize exactly the main subject of the image. The algorithm is based on SmartCrop.js and SmartCrop.py.
  • Removed verbose mode. This was used in earlier stages of development but now don't add value to the experience.
  • The official documentation is almost ready. A link will be available soon

Installing

You can install it via pip or cloning this repository.

[email protected]:~$ pip3 install idt

OR

[email protected]:~$ git clone https://github.com/deliton/idt.git && cd idt
[email protected]:~/idt$ sudo python3 setup.py install

Getting Started

idt-gif

The quickest way to get started with IDT is running the simple "run" command. Just write in your favorite console something like:

[email protected]:~$ idt run -i apples 

This will quickly download 50 images of apples. By default it uses the duckgo search engine to do so. The run command accepts the following options:

Option Description
-i or --input the keyword to find the desired images.
-s or --size the amount of images to be downloaded.
-e or --engine the desired search engine (options: duckgo, bing, bing_api and flickr_api)
--resize-method choose a resize method of images. (options: longer_side, shorter_side and smartcrop)
-is or --image-size option to set the desired image size ratio. default=512
-ak or --api-key If you are using a search engine that requires an API key, this option is required

Usage

IDT requires a config file that tells it how your dataset should be organized. You can create it using the following command:

[email protected]:~$ idt init

This command will trigger the config file creator and will ask for the desired dataset parameters. In this example let's create a dataset containing images of your favorite cars. The first parameters this command will ask is what name should your dataset have? In this example, let's name our dataset "My favorite cars"

Insert a name  for your dataset: : My favorite cars

Then the tool will ask how many samples per search are required to mount your dataset. In order to build a good dataset for deep learning, many images are required and since we're using a search engine to scrape images, many searches with different keywords are required to mount a good sized dataset. This value will correspond to how many images should be downloaded at every search. In this example we need a dataset with 250 images in each class, and we'll use 5 keywords to mount each class. So if we type the number 50 here, IDT will download 50 images of every keyword provided. If we provide 5 keywords we should get the required 250 images.

How many samples per search will be necessary?  : 50

The tool will now ask for and image size ratio. Since using large images to train neural networks is not a viable thing, we can optionally choose one of the following image size ratios and scale down our images to that size. In this example, we'll go for 512x512, although 256x256 would be an even better option for this task.

Choose images resolution:

[1] 512 pixels / 512 pixels (recommended)
[2] 1024 pixels / 1024 pixels
[3] 256 pixels / 256 pixels
[4] 128 pixels / 128 pixels
[5] Keep original image size

ps: note that the aspect ratio of the image will not be changed, 
so possibly the images received will have slightly different size

What is the desired image size ratio: 1

And then choose "longer_side" for resize method.

[1] Resize image based on longer side
[2] Resize image based on shorter side
[3] Smartcrop

ps: note that the aspect ratio of the image will not be changed,
so possibly the images received will have slightly different size

Desired Image resize method: : longer_side

Now you must choose how many classes/folders your dataset should have. In this example, this part can be very personal, but my favorite cars are: Chevrolet Impala, Range Rover Evoque, Tesla Model X and (why not) AvtoVAZ Lada. So in this case we have 4 classes, one for each favorite.

How many image classes are required? : 4

Afterwards, you'll be asked to choose between one of the search engines available. In this example, we'll use DuckGO to search images for us.

Choose a search engine:

[1] Duck GO (recommended)
[2] Bing
[3] Bing API 
[4] Flickr API

Select option:: 1

Now we have to do some repetitive form filling. We must name each class and all the keywords that will be used to find the images. Note that this part can be later changed by your own code, to generate more classes and keywords.

Class 1 name: : Chevrolet Impala

After typing the first class name, we'll be asked to provide all the keywords to find the dataset. Remember that we told the program to download 50 images of each keyword so we must provide 5 keywords in this case to get all 250 images. Each keyword MUST be separated by commas(,)

In order to achieve better results, choose several keywords that will
be provided to the search engine to find your class in different settings.

Example: 

Class Name: Pineapple
keywords: pineapple, pineapple fruit, ananas, abacaxi, pineapple drawing

Type in all keywords used to find your desired class, separated by commas: Chevrolet Impala 1967 car photos,
chevrolet impala on the road, chevrolet impala vintage car, chevrolet impala convertible 1961, chevrolet impala 1964 lowrider

Then repeat the process of filling class name and its keywords until you fill all the 4 classes required.

Dataset YAML file has been created successfully. Now run idt build to mount your dataset!

Your dataset configuration file has been created. Now just rust the following command and see the magic happen:

[email protected]:~$ idt build

And wait while the dataset is being mounted:

Creating Chevrolet Impala class
Downloading Chevrolet Impala 1967 car photos  [#########################-----------]   72%  00:00:12

At the end, all your images will be available in a folder with the dataset name. Also, a csv file with the dataset stats are also included in the dataset's root folder.

idt-results

Split image dataset for Deep Learning

Since deep learning often requires you to split your dataset into a subset of training/validation folders, this project can also do this for you! Just run:

[email protected]:~$ idt split

Now you must choose a train/valid proportion. In this example I've chosen that 70% of the images will be reserved for training, while the rest will be reserved for validation:

Choose the desired proportion of images of each class to be distributed in train/valid folders.
What percentage of images should be distributed towards training? 
(0-100): 70

70 percent of the images will be moved to a train folder, while 30 percent of the remaining images
will be stored in a validation folder.
Is that ok? [Y/n]: y

And that's it! The dataset-split should now be found with the corresponding train/valid subdirectories.

Issues

This project is being developed in my spare time and it still needs a lot of effort to be free of bugs. Pull requests and contributors are really appreciated, feel free to contribute in any way you can!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].