Giter Club home page Giter Club logo

find_most_similar_image's Introduction

๐Ÿ‘‹ Hey there! It's Nikolay Nechaev aka @kolayne

A Russian developer and a student at Innopolis University.

Social networks

@kolayne kolay_ne N.Nechaev@innopolis.university

Some statistics!

statistics

About me

Coming soon! one day.

find_most_similar_image's People

Contributors

codacy-badger avatar kolayne avatar

Stargazers

 avatar  avatar

Watchers

 avatar

find_most_similar_image's Issues

Tqdm bars display when forking

It seems to be impossible to both keep using the multiprocessing module and fix the issue of tqdm bars displayed incorrectly when using forking (at least, at the moment). However, there is a PR fixing the issue for threading. I'd like to see the measurements of performance when using one thread, multiple threads, and multiple processes. Probably it's a good idea to switch to threads to fix the problem, but I'm not ready to sacrifice performance on a notable scale

Split the tool into core and CLI

At the moment the tool only consists of one file, which handles everything: analyzing images, saving storages, etc, and communicating with a user via a CLI. I find the latter function completely separate from the rest, and I want the tool to be split into (at least) two files, one of which would handle the search, why the other one would be dealing with cmd-line arguments (and most likely also managing files, while the core will only work with the data it is supposed to process, converted to the format it is going to be processed in).

This will also make it possible to create a good API: even though at the moment users can import the tool as a python module and use it in their programs, we currently force them to use files, wait for json.loads/np.asarray/etc conventions, which can be a tangible performance drawback when trying to process a large amount of data. Separating the core from the rest code would solve this problem

Optimize `get_avg_pixels`

Can we delegate the following piece of code to numpy and thus speed it up?

def get_avg_pixels(img, split_depth=2):
ans = np.zeros((split_depth, split_depth, 3))
img = np.asarray(img)
x_size, y_size, _ = img.shape
for x_multiplier in range(split_depth):
x_range_from = int(x_size / split_depth * x_multiplier)
x_range_to = int(x_size / split_depth * (x_multiplier + 1))
for y_multiplier in range(split_depth):
y_range_from = int(y_size / split_depth * y_multiplier)
y_range_to = int(y_size / split_depth * (y_multiplier + 1))
ans[x_multiplier, y_multiplier] = avg(img[x_range_from:x_range_to, y_range_from:y_range_to].ravel())
return ans

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.