Giter Club home page Giter Club logo

sis's Introduction

Simple Image Search Engine

Workflow

News

Overview

  • Simple image-based image search engine using Keras + Flask. You can launch the search engine just by running two python scripts.
  • offline.py: This script extracts a deep-feature from each database image. Each feature is a 4096D fc6 activation from a VGG16 model with ImageNet pre-trained weights.
  • server.py: This script runs a web-server. You can send your query image to the server via a Flask web-interface. The server finds similar images to the query by a simple linear scan.
  • GPUs are not required.
  • Tested on Ubuntu 18.04 and WSL2 (Ubuntu 20.04)

Links

Usage

git clone https://github.com/matsui528/sis.git
cd sis
pip install -r requirements.txt

# Put your image files (*.jpg) on static/img

# Then fc6 features are extracted and saved on static/feature
# Note that it takes time for the first time because Keras downloads the VGG weights.
python offline.py

# Now you can do the search via localhost:5000
python server.py

Advanced: Launch on AWS

  • You can easily launch the search engine server on AWS EC2. Please first open the port 5000 and launch an EC2 instance. Note that you need to create a security group such that the port 5000 is opened.
  • A middle-level CPU instance is sufficient, e.g., m5.large.
  • After you log-in to the instance by ssh, please setup the python environment (e.g., by anaconda).
  • Run offline.py and server.py.
  • After you run python server.py, you can access the server from your browser via something like http://ec2-XX-XX-XXX-XXX.us-west-2.compute.amazonaws.com:5000
  • (Advanced) If you'd like to deploy the system in a secure way, please consider running the search engine with the usual web server, e.g., uWSGI + nginx.
  • (Advanced) If you want to deploy the system serverlessly, AWS AppRunner is the way to go.

Citation

@misc{sis,
    author = {Yusuke Matsui},
    title = {Simple Image Search Engine},
    howpublished = {\url{https://github.com/matsui528/sis}}
}

sis's People

Contributors

matsui528 avatar przemb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sis's Issues

500 internal server error

127.0.0.1 - - [09/Apr/2019 17:20:26] "GET / HTTP/1.1" 200 -
[2019-04-09 17:20:34,386] ERROR in app: Exception on / [POST]
Traceback (most recent call last):
File "/home/anshul/.local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/home/anshul/.local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/anshul/.local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/anshul/.local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/home/anshul/.local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/anshul/.local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "server.py", line 31, in index
dists = np.linalg.norm(features - query, axis=1) # Do search
ValueError: operands could not be broadcast together with shapes (0,) (4096,)
127.0.0.1 - - [09/Apr/2019 17:20:34] "POST / HTTP/1.1" 500 -

please sir help in resolving this issue ...i need this project urgently

500 internal server error

Getting this error

Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "server.py", line 30, in index
query = fe.extract(img)
File "/Users/rbreve/Developer/opencv/sis/feature_extractor.py", line 18, in extract
feature = self.model.predict(x)[0] # (1, 4096) -> (4096, )
File "/usr/local/lib/python2.7/site-packages/keras/engine/training.py", line 1832, in predict
self._make_predict_function()
File "/usr/local/lib/python2.7/site-packages/keras/engine/training.py", line 1031, in _make_predict_function
**kwargs)
File "/usr/local/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py", line 2506, in function
return Function(inputs, outputs, updates=updates, **kwargs)
File "/usr/local/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py", line 2449, in init
with tf.control_dependencies(self.outputs):
File "/usr/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 5027, in control_dependencies
return get_default_graph().control_dependencies(control_inputs)
File "/usr/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 4631, in control_dependencies
c = self.as_graph_element(c)
File "/usr/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 3590, in as_graph_element
return self._as_graph_element_locked(obj, allow_tensor, allow_operation)
File "/usr/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 3669, in _as_graph_element_locked
raise ValueError("Tensor %s is not an element of this graph." % obj)
ValueError: Tensor Tensor("fc1/Relu:0", shape=(?, 4096), dtype=float32) is not an element of this graph.
127.0.0.1 - - [23/May/2018 12:16:20] "POST / HTTP/1.1" 500 -

Tensorflow version issue

Hi- after your new update, we still have the version issue. I would appreciate your comment/update. thank you

pr_curve_pb = _pr_curve_summary.pb
AttributeError: module 'tensorboard.plugins.pr_curve.summary' has no attribute 'pb'

file "offline.py", line 5, in
from feature_extractor import FeatureExtractor
File "/Users/apple/Desktop/sis-master/feature_extractor.py", line 1, in
from keras.preprocessing import image
File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/keras/init.py", line 3, in
from . import utils
File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/keras/utils/init.py", line 6, in
from . import conv_utils
File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/keras/utils/conv_utils.py", line 9, in
from .. import backend as K
File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/keras/backend/init.py", line 1, in
from .load_backend import epsilon
File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/keras/backend/load_backend.py", line 90, in
from .tensorflow_backend import *
File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 5, in
import tensorflow as tf
File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/init.py", line 98, in
from tensorflow_core import *
File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow_core/init.py", line 45, in
from . _api.v2 import compat
File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow_core/_api/v2/compat/init.py", line 24, in
from . import v2
File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow_core/_api/v2/compat/v2/init.py", line 32, in
from . import compat
File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow_core/_api/v2/compat/v2/compat/init.py", line 23, in
from tensorflow._api.v2.compat import v1
File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow_core/_api/v2/compat/init.py", line 24, in
from . import v2
File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow_core/_api/v2/compat/v2/init.py", line 314, in
from tensorboard.summary._tf import summary
File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorboard/summary/init.py", line 25, in
from tensorboard.summary import v1
File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorboard/summary/v1.py", line 46, in
pr_curve_pb = _pr_curve_summary.pb
AttributeError: module 'tensorboard.plugins.pr_curve.summary' has no attribute 'pb'

Getting internal server error while running flask app on default route http://127.0.0.1:5000/

application.py
`import os

from flask import Flask, render_template, request
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker

app = Flask(name)

engine = create_engine("postgresql://postgres:123@localhost:5432/lecture3")
db=scoped_session(sessionmaker(bind=engine))

@app.route("/")
def index():
flights = db.execute("SELECT * FROM flights").fetchall()
return render_template("index.html", flights=flights)

@app.route("/book", methods=["POST"])
def book():
"Book a flight."

name = request.form.get()

if name == 'main':
app.run()
`

I am getting error while running the project

Hello all,

I am getting below error while running this project. Please help me with this.

Traceback (most recent call last):
  File "/anaconda3/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/anaconda3/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/anaconda3/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/anaconda3/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/anaconda3/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/anaconda3/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "server.py", line 32, in index
    query = fe.extract(img)
  File "/Users/manojdeshpande/image_seach/sis/feature_extractor.py", line 29, in extract
    feature = self.model.predict(x)[0]  # (1, 4096) -> (4096, )
  File "/anaconda3/lib/python3.6/site-packages/tensorflow/python/keras/engine/training.py", line 1113, in predict
    self, x, batch_size=batch_size, verbose=verbose, steps=steps)
  File "/anaconda3/lib/python3.6/site-packages/tensorflow/python/keras/engine/training_arrays.py", line 195, in model_iteration
    f = _make_execution_function(model, mode)
  File "/anaconda3/lib/python3.6/site-packages/tensorflow/python/keras/engine/training_arrays.py", line 122, in _make_execution_function
    return model._make_execution_function(mode)
  File "/anaconda3/lib/python3.6/site-packages/tensorflow/python/keras/engine/training.py", line 1989, in _make_execution_function
    self._make_predict_function()
  File "/anaconda3/lib/python3.6/site-packages/tensorflow/python/keras/engine/training.py", line 1979, in _make_predict_function
    **kwargs)
  File "/anaconda3/lib/python3.6/site-packages/tensorflow/python/keras/backend.py", line 3201, in function
    return GraphExecutionFunction(inputs, outputs, updates=updates, **kwargs)
  File "/anaconda3/lib/python3.6/site-packages/tensorflow/python/keras/backend.py", line 2939, in __init__
    with ops.control_dependencies(self.outputs):
  File "/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 5028, in control_dependencies
    return get_default_graph().control_dependencies(control_inputs)
  File "/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 4528, in control_dependencies
    c = self.as_graph_element(c)
  File "/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3478, in as_graph_element
    return self._as_graph_element_locked(obj, allow_tensor, allow_operation)
  File "/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3557, in _as_graph_element_locked
    raise ValueError("Tensor %s is not an element of this graph." % obj)
ValueError: Tensor Tensor("fc1/Relu:0", shape=(?, 4096), dtype=float32) is not an element of this graph.

Regards,
Manoj

getting server error while running server.py

Hello.

while I do the same process and the first file is working for features extractor but when I run server.py and get a web UI then provide query image getting the following result.

##ERROR

Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

  • Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
    127.0.0.1 - - [07/Sep/2019 08:18:23] "GET / HTTP/1.1" 200 -
    [2019-09-07 08:18:29,635] ERROR in app: Exception on / [POST]
    Traceback (most recent call last):
    File "C:\Users\Muhammad Khalid\Anaconda3\lib\site-packages\flask\app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
    File "C:\Users\Muhammad Khalid\Anaconda3\lib\site-packages\flask\app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
    File "C:\Users\Muhammad Khalid\Anaconda3\lib\site-packages\flask\app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
    File "C:\Users\Muhammad Khalid\Anaconda3\lib\site-packages\flask_compat.py", line 35, in reraise
    raise value
    File "C:\Users\Muhammad Khalid\Anaconda3\lib\site-packages\flask\app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
    File "C:\Users\Muhammad Khalid\Anaconda3\lib\site-packages\flask\app.py", line 1799, in dispatch_request
    return self.view_functionsrule.endpoint
    File "C:\Users\Muhammad Khalid\Downloads\sis-master\server.py", line 28, in index
    img.save(uploaded_img_path)
    File "C:\Users\Muhammad Khalid\Anaconda3\lib\site-packages\PIL\Image.py", line 1991, in save
    fp = builtins.open(filename, "w+b")
    OSError: [Errno 22] Invalid argument: 'static/uploaded/2019-09-07T08:18:29.575887_9171c7e3180c3c6fc59134538c01116.jpg'
    127.0.0.1 - - [07/Sep/2019 08:18:29] "POST / HTTP/1.1" 500 -

any help.@matsui528

Server error

Hello,

I installed this repo and configured it correctly. However, when I ran it and query an image, I get the below internal server error.

Please assist

image

Can use face to array in feature_extractor.py?

Hello!

In this super repository python script feature_extractor.py make array from all image with Keras.
I want processing faces off 10 peoples. But i want get array from faces of this people.
Is it possible in this? With dlib?
Thank you advance

There's something wrong about Internal Server Error.

when i press the submit button, something wrong with flask, Internal Server Error 500 happen.
this is the mistake info:
[2018-03-24 17:14:22,079] ERROR in app: Exception on / [POST]
Traceback (most recent call last):
File "C:\Users\wzc118\Anaconda3\lib\site-packages\flask\app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "C:\Users\wzc118\Anaconda3\lib\site-packages\flask\app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:\Users\wzc118\Anaconda3\lib\site-packages\flask\app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "C:\Users\wzc118\Anaconda3\lib\site-packages\flask_compat.py", line 33, in reraise
raise value
File "C:\Users\wzc118\Anaconda3\lib\site-packages\flask\app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "C:\Users\wzc118\Anaconda3\lib\site-packages\flask\app.py", line 1598, in dispatch_request
return self.view_functionsrule.endpoint
File "server.py", line 28, in index
img.save(uploaded_img_path)
File "C:\Users\wzc118\Anaconda3\lib\site-packages\PIL\Image.py", line 1890, in save
fp = builtins.open(filename, "w+b")
OSError: [Errno 22] Invalid argument: 'static/uploaded/2018-03-24T17:14:22.047335_203006213_202149811_225504129_2017_12_28_And_1514462132702-1244746321.jpg'
127.0.0.1 - - [24/Mar/2018 17:14:22] "POST / HTTP/1.1" 500 -
[2018-03-24 17:18:22,427] ERROR in app: Exception on / [POST]
Traceback (most recent call last):
File "C:\Users\wzc118\Anaconda3\lib\site-packages\flask\app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "C:\Users\wzc118\Anaconda3\lib\site-packages\flask\app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:\Users\wzc118\Anaconda3\lib\site-packages\flask\app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "C:\Users\wzc118\Anaconda3\lib\site-packages\flask_compat.py", line 33, in reraise
raise value
File "C:\Users\wzc118\Anaconda3\lib\site-packages\flask\app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "C:\Users\wzc118\Anaconda3\lib\site-packages\flask\app.py", line 1598, in dispatch_request
return self.view_functionsrule.endpoint
File "server.py", line 28, in index
img.save(uploaded_img_path)
File "C:\Users\wzc118\Anaconda3\lib\site-packages\PIL\Image.py", line 1890, in save
fp = builtins.open(filename, "w+b")
OSError: [Errno 22] Invalid argument: 'static/uploaded/2018-03-24T17:18:22.395500_203006213_202149811_225504129_2017_12_28_And_1514462132702-1244746321.jpg'
127.0.0.1 - - [24/Mar/2018 17:18:22] "POST / HTTP/1.1" 500 -

Getting 0.0.0.0 refused to connect

Hello,
When running "server.py" I got:

  • Serving Flask app "server" (lazy loading)
  • Environment: production
    WARNING: This is a development server. Do not use it in a production deployment.
    Use a production WSGI server instead.
  • Debug mode: off
  • Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)

I copied URL: http://0.0.0.0:5000/ to run on Chorme, I got
This site can’t be reached
0.0.0.0 refused to connect.

Could you please help me? Thank you!

i have a problem.

i have a problem.
Can you help me?

======================================================
(j16134uk) EUNHYUKui-MacBook-Pro:sis eunhyulkim$ python server.py
Using TensorFlow backend.
WARNING:tensorflow:From /Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:74: The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead.

WARNING:tensorflow:From /Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:517: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

WARNING:tensorflow:From /Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:4138: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.

WARNING:tensorflow:From /Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:3976: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.

WARNING:tensorflow:From /Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:174: The name tf.get_default_session is deprecated. Please use tf.compat.v1.get_default_session instead.

WARNING:tensorflow:From /Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:181: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.

2019-11-13 14:56:28.253959: I tensorflow/core/platform/cpu_feature_guard.cc:145] This TensorFlow binary is optimized with Intel(R) MKL-DNN to use the following CPU instructions in performance critical operations: SSE4.1 SSE4.2 AVX AVX2 FMA
To enable them in non-MKL-DNN operations, rebuild TensorFlow with the appropriate compiler flags.
2019-11-13 14:56:28.254322: I tensorflow/core/common_runtime/process_util.cc:115] Creating new thread pool with default inter op setting: 4. Tune using inter_op_parallelism_threads for best performance.

  • Serving Flask app "server" (lazy loading)
  • Environment: production
    WARNING: This is a development server. Do not use it in a production deployment.
    Use a production WSGI server instead.
  • Debug mode: off
  • Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
    127.0.0.1 - - [13/Nov/2019 14:56:46] "GET / HTTP/1.1" 200 -
    [2019-11-13 14:56:52,113] ERROR in app: Exception on / [POST]
    Traceback (most recent call last):
    File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
    File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/flask/app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
    File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/flask/app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
    File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
    File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
    File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functionsrule.endpoint
    File "server.py", line 30, in index
    query = fe.extract(img)
    File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/sis/feature_extractor.py", line 19, in extract
    feature = self.model.predict(x)[0] # (1, 4096) -> (4096, )
    File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/keras/engine/training.py", line 1164, in predict
    self._make_predict_function()
    File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/keras/engine/training.py", line 554, in _make_predict_function
    **kwargs)
    File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2744, in function
    return Function(inputs, outputs, updates=updates, **kwargs)
    File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2546, in init
    with tf.control_dependencies(self.outputs):
    File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 5426, in control_dependencies
    return get_default_graph().control_dependencies(control_inputs)
    File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 4867, in control_dependencies
    c = self.as_graph_element(c)
    File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3796, in as_graph_element
    return self._as_graph_element_locked(obj, allow_tensor, allow_operation)
    File "/Users/eunhyulkim/opt/anaconda3/envs/j16134uk/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3875, in _as_graph_element_locked
    raise ValueError("Tensor %s is not an element of this graph." % obj)
    ValueError: Tensor Tensor("fc1/Relu:0", shape=(?, 4096), dtype=float32) is not an element of this graph.
    127.0.0.1 - - [13/Nov/2019 14:56:52] "POST / HTTP/1.1" 500 -

======================================================

Image folder

Do images must be placed in the static folder?

Version details

Hi , can you please tell me the version details of keras?

Because I am getting this error :- ValueError: operands could not be broadcast together with shapes (0,) (4096,)

Benchmark

Hi !
Do you have any idea what performance it would be if I used 5 million images? How long would it take to return similar images?
Can the feature extraction process be done with GPU?

Regards,
João

occur error

hello,I follow this repo,but occure error as follow,and my OS windows:

        raise ValueError(err_msg)

 

    elif isinstance(obj, Tensor) and allow_tensor:

      # Actually obj is just the object it's referring to.

      if obj.graph is not self:

        raise ValueError("Tensor %s is not an element of this graph." % obj)

      return obj

    elif isinstance(obj, Operation) and allow_operation:

      # Actually obj is just the object it's referring to.

      if obj.graph is not self:

        raise ValueError("Operation %s is not an element of this graph." % obj)

ValueError: Tensor Tensor("fc1/Relu:0", shape=(?, 4096), dtype=float32) is not an element of this graph.

Problem in downloading weights

sir i had tried to download weights more than 20 times.when i start downloading it stops after sometime and then again start from beginning. i also downloaded file manually but it shows there is something missing in file and whenever i run server.py its starts downloading from beginning and same issue it stops after some time. please look into this issue,i hope i will get positive response from your side.i will appreciate if you provide some better and optimized solution.
Thankyou sir
Anshul
Screenshot from 2019-04-07 10-23-26

Tensorflow version

It seems that your code does not work with Tensorflow 2 (AttributeError: module 'tensorflow' has no attribute 'get_default_graph'). I have downgraded it to 1.4, but I encoutered another error (ImportError: cannot import name 'tf_utils')....
could you please let m know what version of TF did you use? tnx

where is database?

Hi,
I set up the environment started server and can see html file on localhost:5000 . But where is database this query image search for?

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.