GithubHelp home page GithubHelp logo

ankonzoid / artificio Goto Github PK

View Code? Open in Web Editor NEW
407.0 21.0 215.0 2.95 MB

Deep Learning Computer Vision Algorithms for Real-World Use

License: Apache License 2.0

Python 100.00%
deep-learning neural-networks applications artificial-intelligence auto-encoders convolutional-neural-networks image-finder transfer-learning computer-vision image-recognition

artificio's Introduction

artificio's People

Contributors

ankonzoid 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

artificio's Issues

run the model but get the error, help please!

Hello! Thanks for your sharing, I get a TyoeError when I run the model, and I do not know how to solve it.
On ubuntu14.04, python3.5.2
Detail as following:
Traceback (most recent call last):
File "image_rec.py", line 357, in
main()
File "image_rec.py", line 204, in main
MODEL.load_model(dictfn)
File "/home/naver/line-brain/lixun/cnn-based/image_rec/algo/autoencoders/AE.py", line 137, in load_model
self.encoder = load_model(encoder_filename)
File "/usr/local/lib/python3.5/dist-packages/keras/models.py", line 240, in load_model
with h5py.File(filepath, mode='r') as f:
File "/usr/local/lib/python3.5/dist-packages/h5py/_hl/files.py", line 271, in init
fid = make_fid(name, mode, userblock_size, fapl, swmr=swmr)
File "/usr/local/lib/python3.5/dist-packages/h5py/_hl/files.py", line 101, in make_fid
fid = h5f.open(name, flags, fapl=fapl)
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (/tmp/pip-huypgcah-build/h5py/_objects.c:2840)
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (/tmp/pip-huypgcah-build/h5py/_objects.c:2798)
File "h5py/h5f.pyx", line 78, in h5py.h5f.open (/tmp/pip-huypgcah-build/h5py/h5f.c:2117)
OSError: Unable to open file (Unable to open file: name = 'db/models/convae_encoder.h5', errno = 2, error message = 'no such file or directory', flags = 0, o_flags = 0)
Exception ignored in: <bound method BaseSession.del of <tensorflow.python.client.session.Session object at 0x7f8d737435f8>>
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 595, in del
TypeError: 'NoneType' object is not callable

Seems to require keras 2.2.0

I was getting the usual error on 2.4.0

https://stackoverflow.com/questions/49113140/importerror-cannot-import-name-obtain-input-shape-from-keras

$ python3 ./similar_images_TL.py 
Using TensorFlow backend.
Traceback (most recent call last):
  File "./similar_images_TL.py", line 17, in <module>
    from vgg19 import VGG19
  File "src/vgg19.py", line 26, in <module>
    from keras.applications.imagenet_utils import _obtain_input_shape
ImportError: cannot import name '_obtain_input_shape'

uninstalling and switching to 2.2.0 fixed it for me

pip install keras==2.2.0

so could be something missing from the documentation? thanks for the interesting project!

I met this error when run

Hi, @zdyang @ouzoh @ankonzoid

I met this error when run similar_images_TL.py .

elxAir:similar_images_TL elx$ python3 similar_images_TL.py
Using TensorFlow backend.
Traceback (most recent call last):
File "similar_images_TL.py", line 17, in
from vgg19 import VGG19
File "src/vgg19.py", line 26, in
from keras.applications.imagenet_utils import _obtain_input_shape
ImportError: cannot import name '_obtain_input_shape' from 'keras.applications.imagenet_utils' (/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/keras/applications/imagenet_utils.py)

What's wrong to me?

Error: 'config': model.optimizer.get_config()

Hi
Great example ! I am having some issues early on:

File "image_retrieval.py", line 116, in <module>
    model.save_models()
  File "/home/jacques/work/fontf/artificio/image_retrieval/src/autoencoder.py", line 131, in save_models
    self.encoder.save(self.info["encoderFile"])
  File "/home/jacques/.virtualenvs/ml/lib/python3.6/site-packages/tensorflow/python/keras/_impl/keras/engine/network.py", line 1129, in save
    save_model(self, filepath, overwrite, include_optimizer)
  File "/home/jacques/.virtualenvs/ml/lib/python3.6/site-packages/tensorflow/python/keras/_impl/keras/engine/saving.py", line 149, in save_model
    'config': model.optimizer.get_config()
AttributeError: 'NoneType' object has no attribute 'get_config'

Query the kNN with new pictures

Hi, I'm trying to use the code to train an kNN model with a set of images. Then I'd like to get a new image (not included in the model) and get the most similar images.

Is it possible to do something like this? I tried using knn.predict(new_img_features) but I get an error and that could be because of the kNN used here is not a classifier.

Error when running code on custom dataset

Hi @ankonzoid . Thanks for the code.

I am trying to run your code on my dataset which contains 500 random animal images of size 512x 512.
Code abrupty stops with this error.

Reading train images from '.....\dataset\data2\train'...
Reading test images from '......\dataset\data2\test'...
Image shape = (512, 512, 3)
Loading VGG19 pre-trained model...
2020-08-07 23:02:22.275737: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
input_shape_model = (512, 512, 3)
output_shape_model = (16, 16, 512)
Applying image transformer to training images...
Applying image transformer to test images...
-> X_train.shape = (200, 512, 512, 3)
-> X_test.shape = (5, 512, 512, 3)
Inferencing embeddings using pre-trained model...
2020-08-07 23:02:59.016060: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 2147483648 exceeds 10% of system memory.
2020-08-07 23:03:45.605916: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 2147483648 exceeds 10% of system memory.

Please help!!

[Help!!]error of spawning new processes while running image_retrieval.py

I am getting the following error of spawning the process while running "python image_retrieval.py"

Brief error message:
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if name == 'main':
freeze_support()

error.txt

Can anyone plz help me saying why I am getting this error and how to get rid of this error?

Decoders shape is changing

Im getting the below error when I try to fit the model.

ValueError: A target array with shape (73, 458, 690, 3) was passed for an output of shape (None, 460, 692, 3) while using as loss binary_crossentropy. This loss expects targets to have the same shape as the output.

The summary of the autoencoder is,

autoencoder.summary():


Layer (type) Output Shape Param #

input_1 (InputLayer) (None, 458, 690, 3) 0


conv2d (Conv2D) (None, 458, 690, 16) 448


max_pooling2d (MaxPooling2D) (None, 229, 345, 16) 0


conv2d_1 (Conv2D) (None, 229, 345, 8) 1160


max_pooling2d_1 (MaxPooling2 (None, 115, 173, 8) 0


conv2d_2 (Conv2D) (None, 115, 173, 8) 584


max_pooling2d_2 (MaxPooling2 (None, 58, 87, 8) 0


conv2d_3 (Conv2D) (None, 58, 87, 8) 584


up_sampling2d (UpSampling2D) (None, 116, 174, 8) 0


conv2d_4 (Conv2D) (None, 116, 174, 8) 584


up_sampling2d_1 (UpSampling2 (None, 232, 348, 8) 0


conv2d_5 (Conv2D) (None, 230, 346, 16) 1168


up_sampling2d_2 (UpSampling2 (None, 460, 692, 16) 0


conv2d_6 (Conv2D) (None, 460, 692, 3) 435

Total params: 4,963
Trainable params: 4,963
Non-trainable params: 0


None

The decoder shape is changing at some point. Can you help me in fixing this issue.

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.