Giter VIP home page Giter VIP logo

deepcolor's People

Contributors

kvfrans 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

deepcolor's Issues

Is any err in this code?

i clone the repo ,and download 10000imgs with the download_img.py. then i run python main.y train, and a week later with 3 million iterations i got my own model. when i type python main.y sample. the result looks like a noise picture,it can recognize nothing. i did't modify any your code, just want to try it. besize,the model that you pretrained also behaves as mess picture. emmmm, i'm so sad.

Application fails w/ ubuntu 16.04

Command:

python main.py sample

Error:

python main.py sample
Traceback (most recent call last):
  File "main.py", line 238, in <module>
    c = Color(512,1)
  File "main.py", line 37, in __init__
    combined_preimage = tf.concat(3, [self.line_images, self.color_images])
  File "/home/mvillmow/.local/lib/python2.7/site-packages/tensorflow/python/ops/array_ops.py", line 1061, in concat
    dtype=dtypes.int32).get_shape(
  File "/home/mvillmow/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 611, in convert_to_tensor
    as_ref=False)
  File "/home/mvillmow/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 676, in internal_convert_to_tensor
    ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
  File "/home/mvillmow/.local/lib/python2.7/site-packages/tensorflow/python/framework/constant_op.py", line 121, in _constant_tensor_conversion_function
    return constant(v, dtype=dtype, name=name)
  File "/home/mvillmow/.local/lib/python2.7/site-packages/tensorflow/python/framework/constant_op.py", line 102, in constant
    tensor_util.make_tensor_proto(value, dtype=dtype, shape=shape, verify_shape=verify_shape))
  File "/home/mvillmow/.local/lib/python2.7/site-packages/tensorflow/python/framework/tensor_util.py", line 376, in make_tensor_proto
    _AssertCompatible(values, dtype)
  File "/home/mvillmow/.local/lib/python2.7/site-packages/tensorflow/python/framework/tensor_util.py", line 302, in _AssertCompatible
    (dtype.name, repr(mismatch), type(mismatch).__name__))
TypeError: Expected int32, got list containing Tensors of type '_Message' instead.

Repro steps:

git clone https://github.com/kvfrans/deepcolor.git
pip install --user tensorflow numpy
sudo apt-get install python-opencv
python main.py sample

error occured during downloading dataset

it scrapped around 80 pics then this error occured

File "download_images.py", line 25, in
image = np.asarray(bytearray(resp.read()), dtype="uint8")
File "C:\Python27\lib\socket.py", line 355, in read
data = self._sock.recv(rbufsize)
socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host

Some questions about your code

Thank you for sharing!!

I found that you get color_image through bluring :
batch_colors = np.array([self.imageblur(ba,True) for ba in batch]) / 255.0

Bluring is a good way to get color prior when we have groundtruth images. But if I only have a line map (without groundtruth), bluring can not work because bluring a line image can not get any color informations. As your paper said, a color_predict network can predict the color from a line image. I think it is a very nice idea while I found main.py does not realize this part of functions. Maybe you have tried in guess_color.py.

Good job!!

An error with your code

Hi @kvfrans , when I run your code after upgrade to tensorflow 1.0, It get the following error:

python main_v1.py train
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcublas.so.7.5 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcudnn.so.5 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcufft.so.7.5 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcurand.so.7.5 locally
Traceback (most recent call last):
  File "main_v1.py", line 251, in <module>
    c = Color()
  File "main_v1.py", line 73, in __init__
    self.d_optim = tf.train.AdamOptimizer(0.0002, beta1=0.5).minimize(self.d_loss, var_list=self.d_vars)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/optimizer.py", line 289, in minimize
    name=name)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/optimizer.py", line 403, in apply_gradients
    self._create_slots(var_list)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/adam.py", line 117, in _create_slots
    self._zeros_slot(v, "m", self._name)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/optimizer.py", line 647, in _zeros_slot
    named_slots[var] = slot_creator.create_zeros_slot(var, op_name)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/slot_creator.py", line 123, in create_zeros_slot
    colocate_with_primary=colocate_with_primary)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/slot_creator.py", line 101, in create_slot
    return _create_slot_var(primary, val, '')
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/slot_creator.py", line 55, in _create_slot_var
    slot = variable_scope.get_variable(scope, initializer=val, trainable=False)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 988, in get_variable
    custom_getter=custom_getter)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 890, in get_variable
    custom_getter=custom_getter)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 348, in get_variable
    validate_shape=validate_shape)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 333, in _true_getter
    caching_device=caching_device, validate_shape=validate_shape)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.py", line 657, in _get_single_variable
    "VarScope?" % name)
ValueError: Variable d_h0_conv/w/Adam/ does not exist, or was not created with tf.get_variable(). Did you mean to set reuse=None in VarScope?

Could you help me with it ?

What is the license on this?

The repo doesn't have a license doc, I would like to iterate on this idea and implement it, but don't want to get stuck in legal trouble due to intellectual property conflicts.

I have a question about data process "main.imageblur()" +1

thank you for sharing!!!!!!!!!

I get a question while implementing the code and ask.
Is it ok to use it without a deep copy?

test in python3

my test cord this

def imageblur(img, sampling=False):
    if sampling:
        cimg = cimg * 0.3 + np.ones_like(cimg) * 0.7 * 255
    else:
        for i in range(30):
            randx = randint(0,205)
            randy = randint(0,205)
            cimg[randx:randx+50, randy:randy+50] = 255
    return cv2.blur(cimg,(100,100))
img = get_img(path)
img_b = imageblur(img)
nvc = np.concatenate((img,img_b),axis=1)
cv2.imshow("TEST",nvc)

and result ...

2018-10-22 00-36-34

my test cord_2_add deep copy this

def imageblur(img, sampling=False):
    cimg = copy.deepcopy(img) #Add deep copy
    if sampling:
        cimg = cimg * 0.3 + np.ones_like(cimg) * 0.7 * 255
    else:
        for i in range(30):
            randx = randint(0,205)
            randy = randint(0,205)
            cimg[randx:randx+50, randy:randy+50] = 255
    return cv2.blur(cimg,(100,100))
img = get_img(path)
img_b = imageblur(img)
nvc = np.concatenate((img,img_b),axis=1)
cv2.imshow("TEST",nvc)

and result
2018-10-22 00-35-59

And one more
why expand edge image dims in placeholder set dim 1
I am curious as to whether it should be expanded

            batch_edge = np.expand_dims(batch_edge, 3)

Thank you again for sharing. !!

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.