GithubHelp home page GithubHelp logo

deep-anpr's People

Contributors

matthewearl 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  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

deep-anpr's Issues

Faster localization

The current windowing scheme makes the detection process rather slow. The main reason for this is the high overlap between windows: Each pixel is covered at least 128 times at each scale, and there are a large number of scales processed due to the conservative scaling factor of root 2.

Inspired by Joseph Redmon et al.'s YOLO paper I propose applying a neural network in windows with no overlap within a particular scale (ie. a disjoint tiling), and with a larger scaling factor. The network output would be a regression similar to the YOLO bounding box predictor. The predicted bounding boxes would then be passed to the existing network in order to read the numbers.

implementation on c++?

hi! i was trying also this project, is someone trying or implementing this on c/c++?
greeetz!

Error rate

hello,

plz how can i visualize the error rate in the code ?

Thanks,

Error While Running train.py

I am getting this error when I try to run train.py, any idea why ?? Thanks

Traceback (most recent call last):
File "C:\Users...\AppData\Roaming\Python\Python35\site-packages\tensorflow\python\client\session.py", line 1039, in _do_call
return fn(*args)
File "C:\Users...\AppData\Roaming\Python\Python35\site-packages\tensorflow\python\client\session.py", line 1021, in _run_fn
status, run_metadata)
File "C:\Users...\AppData\Local\Programs\Python\Python35\lib\contextlib.py", line 66, in exit
next(self.gen)
File "C:\Users...\AppData\Roaming\Python\Python35\site-packages\tensorflow\python\framework\errors_impl.py", line 466, in raise_exception_on_not_ok_status
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 50 values, but the requested shape requires a multiple of 36
[[Node: Reshape_1 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/cpu:0"](strided_slice, Reshape_1/shape)]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:/Users/.../PythonPyCharm/Tensorflow_Projects/Plate Recognition/deep-anpr-master/train.py", line 266, in
initial_weights=initial_weights)
File "C:/Users/.../PythonPyCharm/Tensorflow_Projects/Plate Recognition/deep-anpr-master/train.py", line 239, in train
do_batch()
File "C:/Users/.../PythonPyCharm/Tensorflow_Projects/Plate Recognition/deep-anpr-master/train.py", line 222, in do_batch
feed_dict={x: batch_xs, y_: batch_ys})
File "C:\Users...\AppData\Roaming\Python\Python35\site-packages\tensorflow\python\client\session.py", line 778, in run
run_metadata_ptr)
File "C:\Users...\AppData\Roaming\Python\Python35\site-packages\tensorflow\python\client\session.py", line 982, in _run
feed_dict_string, options, run_metadata)
File "C:\Users...\AppData\Roaming\Python\Python35\site-packages\tensorflow\python\client\session.py", line 1032, in _do_run
target_list, options, run_metadata)
File "C:\Users...\AppData\Roaming\Python\Python35\site-packages\tensorflow\python\client\session.py", line 1052, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 50 values, but the requested shape requires a multiple of 36
[[Node: Reshape_1 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/cpu:0"](strided_slice, Reshape_1/shape)]]

Caused by op 'Reshape_1', defined at:
File "C:/Users/.../PythonPyCharm/Tensorflow_Projects/Plate Recognition/deep-anpr-master/train.py", line 266, in
initial_weights=initial_weights)
File "C:/Users/.../PythonPyCharm/Tensorflow_Projects/Plate Recognition/deep-anpr-master/train.py", line 174, in train
digits_loss, presence_loss, loss = get_loss(y, y_)
File "C:/Users/.../PythonPyCharm/Tensorflow_Projects/Plate Recognition/deep-anpr-master/train.py", line 130, in get_loss
[-1, len(common.CHARS)]),
File "C:\Users...\AppData\Roaming\Python\Python35\site-packages\tensorflow\python\ops\gen_array_ops.py", line 2510, in reshape
name=name)
File "C:\Users...\AppData\Roaming\Python\Python35\site-packages\tensorflow\python\framework\op_def_library.py", line 768, in apply_op
op_def=op_def)
File "C:\Users...\AppData\Roaming\Python\Python35\site-packages\tensorflow\python\framework\ops.py", line 2336, in create_op
original_op=self._default_original_op, op_def=op_def)
File "C:\Users...\AppData\Roaming\Python\Python35\site-packages\tensorflow\python\framework\ops.py", line 1228, in init
self._traceback = _extract_stack()

InvalidArgumentError (see above for traceback): Input to reshape is a tensor with 50 values, but the requested shape requires a multiple of 36
[[Node: Reshape_1 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/cpu:0"](strided_slice, Reshape_1/shape)]]

Faster detection

Hello everyone,

I use the YOLO method to detect the plates in 0.02 seconds. Now I would like to read the plate with the Mattwew Earl method by entering the area containing the plate directly in order to optimize the time. Do you have an idea ?

Thank's

Error in train.py

There is an error in train.py script

Error is:
File "train.py", line 66, in read_data
code = fname.split("/")[1][9:16]
IndexError: list index out of range

ValueError: Cannot feed value of shape (2048,) for Tensor u'Variable_6:0', which has shape '(32768, 2048)'

This error shows when I run
./detect.py test/00000361_PI50NFZ_1.png weights.npz out.jpg :

libdc1394 error: Failed to initialize libdc1394
Traceback (most recent call last):
  File "./detect.py", line 178, in <module>
    detect(im_gray, param_vals)):
  File "./detect.py", line 152, in post_process
    groups = _group_overlapping_rectangles(matches)
  File "./detect.py", line 125, in _group_overlapping_rectangles
    matches = list(matches)
  File "./detect.py", line 87, in detect
    y_vals.append(sess.run(y, feed_dict=feed_dict))
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 766, in run
    run_metadata_ptr)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 943, in _run
    % (np_val.shape, subfeed_t.name, str(subfeed_t.get_shape())))
ValueError: Cannot feed value of shape (2048,) for Tensor u'Variable_6:0', which has shape '(32768, 2048)'

```


I read that this error `libdc1394 error: Failed to initialize libdc1394` is not a problem. The main error is a shape problem that I cant fix yet. I have tryed loading several images (also one taken by me). Can anyone help me?

Can not run the detect.py?

"~/deep-anpr$ ./detect.py Proton_Saga_EV_at_the_RAC_Future_Car_Challenge_2011,_U.K.jpg weights.npz out.jpg
Traceback (most recent call last):
File "./detect.py", line 186, in
detect(im_gray, param_vals)):
File "./detect.py", line 160, in post_process
groups = _group_overlapping_rectangles(matches)
File "./detect.py", line 131, in _group_overlapping_rectangles
matches = list(matches)
File "./detect.py", line 91, in detect
feed_dict = {x: numpy.stack([scaled_im])}
AttributeError: 'module' object has no attribute 'stack'"
I don't know why my numpy have no stack function?

detect (any format) plate but not read it

i want to know if it's possible to modify this code enough to just work on detecting where the plate is drawing a bounding box around the region. and not just UK plates. any plate from any county. not try to read any text but just put a box around the region where it detects the plate

Error running ./extractbgs.py SUN397.tar.gz

Hello,
I'm getting this error while trying to execute ./extractbgs.py SUN397.tar.gz !

Traceback (most recent call last):
File "./extractbgs.py", line 97, in
extract_backgrounds(sys.argv[1])
File "./extractbgs.py", line 75, in extract_backgrounds
im = im_from_file(f)
File "./extractbgs.py", line 46, in im_from_file
return cv2.imdecode(a, cv2.CV_LOAD_IMAGE_GRAYSCALE)
AttributeError: 'module' object has no attribute 'CV_LOAD_IMAGE_GRAYSCALE'

can anyone help me please !
Thanks,

Error in proc_start() in train.py

I am running this on windows and facing error in train.py, the error is in proc_start() function on line 103.

This is the complete error:

Traceback (most recent call last):
File "train.py", line 267, in
initial_weights=initial_weights)
File "train.py", line 239, in train
for batch_idx, (batch_xs, batch_ys) in batch_iter:
File "train.py", line 103, in wrapped
proc.start()
File "C:\ProgramData\Anaconda3\lib\multiprocessing\process.py", line 105, in start
self._popen = self._Popen(self)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\context.py", line 212, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\context.py", line 313, in _Popen
return Popen(process_obj)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\popen_spawn_win32.py", line 66, in init
reduction.dump(process_obj, to_child)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\reduction.py", line 59, in dump
ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'mpgen..main'

D:\Project\deep-anpr>Traceback (most recent call last):
File "", line 1, in
File "C:\ProgramData\Anaconda3\lib\multiprocessing\spawn.py", line 106, in spawn_main
exitcode = _main(fd)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\spawn.py", line 116, in _main
self = pickle.load(from_parent)
EOFError: Ran out of input
screenshot 56

Import tensorflow and opencv at the same time?

Hello,
I am working a similar project currently for interests. I am wondering if my understanding of usage is correct. For detection, the detection.py should be run under opencv virtual environment, as for training, the code should be run under tensorflow environment. But in the detection.py, the tensorflow and opencv are imported at the same time. I am a little confused with this.

Error in detect.py

I am getting this error in detect.py. I am running this solution on windows
screenshot 57

Support variable license plate lengths

Currently the detection network architecture only supports number plates with exactly 7 characters. This issue it to track adding support for variable length number plates.

The approach used by Goodfellow et al in the Google house number paper (pdf) is to have multiple separate fully connected/output sub-networks on top of the last convolutional stage. There is one network for each possible character in the output as well as a network to indicate how many characters are in the number plate. (See the Google paper for details.)

The change would require adapting gen.py to output variable length plates, model.py to represent the new network architecture, and train.py and detect.py to properly interface with the new architecture.

Index Error while running train.py

Hi,
I am at the phase of training the network. I ran the extractbgs.py and gen.py with no problem. After that, I got backgrounds and 1000 test samples. However, I could not run train.py with the following error as the next step.
I think it doesn't read those filenames correctly but I don't know how to fix it. Anyone can help?

Traceback (most recent call last):
File "C:\Users\Guest1\Documents\Python Projects\deep-anpr-master\train.py", line 265, in
initial_weights=initial_weights)
File "C:\Users\Guest1\Documents\Python Projects\deep-anpr-master\train.py", line 232, in train
test_xs, test_ys = unzip(list(read_data("test/*.png"))[:50])
File "C:\Users\Guest1\Documents\Python Projects\deep-anpr-master\train.py", line 66, in read_data
code = fname.split('/')[1][9:16]
IndexError: list index out of range

The training part is too slow

I have run the extractbgs.py and gen.py easily just in a short time, following your instruction. However, your train.py has been training for mostly a week (without GPU laptop). It's a really long time I think for just 1000 samples, do you have any idea for this problem, or tell me how long you got your model before? I want to know whether the program is working well?

TypeError: type object argument after * must be a sequence, not generator

Getting TypeError: type object argument after * must be a sequence, not generator
Unzip was defined:
def unzip(*b)

This is the input to unzip():
yield unzip(gen_vecs())

this is gen_vecs():

@mpgen
 def read_batches(batch_size):
    g = gen.generate_ims()
    def gen_vecs():
        for im, c, p in itertools.islice(g, batch_size):
            yield im, code_to_vec(p, c)

    while True:
        yield unzip(gen_vecs())

I tried making gen_vec() a list:
list(gen_vec())

But that returns me:

Traceback (most recent call last):
  File "/home/ec2-user/anaconda2/envs/num_plate_detection/lib/python3.4/multiprocessing/process.py", line 254, in _bootstrap
    self.run()
  File "/home/ec2-user/anaconda2/envs/num_plate_detection/lib/python3.4/multiprocessing/process.py", line 93, in run
    self._target(*self._args, **self._kwargs)
  File "train.py", line 92, in main
    for item in f(*args, **kwargs):
  File "train.py", line 122, in read_batches
    yield unzip(list(gen_vecs()))
  File "train.py", line 118, in gen_vecs
    for im, c, p in itertools.islice(g, batch_size):
  File "/home/ec2-user/num_plate_detection/gen.py", line 282, in generate_ims
    yield generate_im(font_char_ims[random.choice(fonts)], num_bg_images)
  File "/home/ec2-user/num_plate_detection/gen.py", line 235, in generate_im
    bg = generate_bg(num_bg_images)
  File "/home/ec2-user/num_plate_detection/gen.py", line 222, in generate_bg
    bg = cv2.imread(fname, 0) / 255.
TypeError: unsupported operand type(s) for /: 'NoneType' and 'float'

How!

Requirements

Hello,

for are the python requirements for running your code ? Can you provide a requirements.txt file or update the README file ? In particular I wanna know the TensorFlow and OpenCV versions.

ValueError: Only call `softmax_cross_entropy_with_logits` with named arguments (labels=..., logits=..., ...)

I have this error running ./train.py. Does anyone know why?

2017-01-30 07:33:03: I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcublas.so.8.0 locally
2017-01-30 07:33:03: I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcudnn.so.5 locally
2017-01-30 07:33:03: I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcufft.so.8.0 locally
2017-01-30 07:33:03: I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcuda.so.1 locally
2017-01-30 07:33:03: I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcurand.so.8.0 locally
Traceback (most recent call last):
  File "./train.py", line 266, in <module>
    initial_weights=initial_weights)
  File "./train.py", line 174, in train
    digits_loss, presence_loss, loss = get_loss(y, y_)
  File "./train.py", line 132, in get_loss
    [-1, len(common.CHARS)]))
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/nn_ops.py", line 1578, in softmax_cross_entropy_with_logits
    labels, logits)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/nn_ops.py", line 1533, in _ensure_xent_args
    "named arguments (labels=..., logits=..., ...)" % name)
ValueError: Only call `softmax_cross_entropy_with_logits` with named arguments (labels=..., logits=..., ...)

Understanding make_affine_transform in gen.py

@matthewearl Please help me by directing towards some reference link/literature to understand the steps you have employed in make_affine_transform.
I could understand the following:

  1. random generation of rotation matrix
  2. Scale between defined range

though the following code is something i would like to understand more about:
`

Set the scale as large as possible such that the skewed and scaled shape is less than or equal to the desired ratio in either dimension.

scale *= numpy.min(to_size / skewed_size)

Set the translation such that the skewed and scaled image falls within the output shape's bounds.

trans = (numpy.random.random((2,1)) - 0.5) * translation_variation
trans = ((2.0 * trans) ** 5.0) / 2.0
if numpy.any(trans < -0.5) or numpy.any(trans > 0.5):
    out_of_bounds = True
trans = (to_size - skewed_size * scale) * trans

center_to = to_size / 2.
center_from = from_size / 2.

M = euler_to_mat(yaw, pitch, roll)[:2, :2]
M *= scale
M = numpy.hstack([M, trans + center_to - M * center_from])`

I am learning a lot of Python,Tensorflow and Computer Vision with the code you made available....Thanks!

Generated weights.npz file doesn't work for the first image mentioned in the author's blog

Dear All,

I ran train.py successfully to generate the weights.npz, it takes quite long time on my GTX1080 GPU. I kept train.py running over a night.

Then I ran detect.py with the generated weights.npz, it works for the second image (https://commons.wikimedia.org/wiki/File:Proton_Saga_EV_at_the_RAC_Future_Car_Challenge_2011,_U.K.jpg) mentioned in the author's blog,

but the first image (https://commons.wikimedia.org/wiki/File:Google_Street_View_Car_near_Howden,_UK_2.JPG) doesn't work, the detect.py program didn't recognize any characters from the image.

Does anyone meet the same problem? although I debugged into the program for almost a day, but I did't figure out the reason.

Thanks.

Only presence recognition..

I am a follower of your development. I studied whole codes and adapted to my project.
My objective is only about presence recognition using ConvNets.
I collected original images of number plate and added real image to training image with your affine transform code. But something is weird that it is not apparent when presence is True. Sometimes, appropriately scaled and located plate is tagged as False image. I am now considering to improve the guideline of being True for presence.

You wrote.. min and max scale factors. Also some other factors (rotation, translation) are available.
I think these parameters should be improved to make presence value more apparent.

Expected value information

Hello. What are the percentage, loss, digits and presence values that I'm expecting to get the best model? Thanks!

Second branch

Does anyone have this problem about the second branch in the train.py?

Traceback (most recent call last):
File "./train.py", line 253, in
initial_weights=initial_weights)
File "./train.py", line 219, in train
test_xs, test_ys = unzip(list(read_data("test/*.png"))[:50])
File "./train.py", line 72, in unzip
xs, ys = zip(*b)
ValueError: need more than 0 values to unpack

Thank's

can detect more than seven numbers?

i'm very appreciate to know the project? I just want to use to detect some numbers and chracters? can it detect more than seven numbers? Thanks

Real-time detection with deep-anpr ๐Ÿ”ฅ

Hey guys,

I'm new to machine learning, so sorry in advance if what I'm proposing is stupid ๐Ÿ˜…

In one of TensorFlow's example iOS projects, they allow real-time classification using the inception graph.

Would it be possible to output this neural network as a .pb graph file and then use it for real-time detection, similar to the TensorFlow iOS example project?

In my mind, it seems like it would work except the fact that the way the detection works is by using a sliding window instead of directly inputting the whole image into the neural network. Is it still possible to achieve real-time detection with the current architecture?

make char ims

why divide 255 when make_char_ims
' yield c, numpy.array(im)[:, :, 0].astype(numpy.float32) / 255.'
and then mul 255 when generate the images:
'cv2.imwrite(fname, im * 255.)'.

Error running train.py

I'm trying now to run train.py :/ but i got this error !!!
can u help me again !

File "./train.py", line 276, in
initial_weights=initial_weights)
File "./train.py", line 238, in train
sess.run(init)

number plate recognition system vs number plate detection system ?

This is a very interesting work based on deep learning, but the title is misleading, it is NOT a number plate recognition because no individual character detection and recognition are performed at all, instead it only locate number plate from given images.

Let me know if my understanding is incorrect.

Best regards

Error running ./train.py

Hi,

I'm getting this error while trying to execute "train.py", I had a look at the code. but it was not obvious to me the root cause.
This happens the second time 'read_batches' is invoked.

B120 60.00% 60.00% loss: 1295.7512207 (digits: 1057.39453125, presence: 238.356689453) |X X XX X X X X X XX XXX X XX XX X|
time for 60 batches 175.30300498
Process Process-1:
Traceback (most recent call last):
File "/Users/rafael/anaconda2/envs/tensorflow/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/Users/rafael/anaconda2/envs/tensorflow/lib/python2.7/multiprocessing/process.py", line 114, in run
self._target(*self._args, **self._kwargs)
File "./train.py", line 92, in main
for item in f(*args, **kwargs):
File "./train.py", line 122, in read_batches
yield unzip(gen_vecs())
File "./train.py", line 72, in unzip
xs, ys = zip(*b)
TypeError: zip() argument after * must be a sequence, not generator

Confirmation on bounding conditions to mark labels for plate presence

The gen.py decides on presence of plate on two conditions:

  1. Scale bounds
  2. Translation bounds

I found a few images where the presence(p) was not consistent from visual perspective.
Can this lead to slower convergence of the model?
Just wanted a confirmation whether including a tight bound on skew/rotation would help.
00000007_ao18bpq_1
Image 1: license plate is skewed but presence is true
00000038_bf28zck_0
Image 2: license plate is in the image but presence is false

00000034_he17gvs_0
Image 3: license plate is in the image but presence is false

Font types

Fonts.com has a nice article about font type classifications. There are 4 categories with 17 sub-categories, which only some of them are used in license plates. So the types you may consider are can be these below.

Serif Type Styles: Slab Serif.
Sans Serif Type Styles: All four of them.
Script Type Styles: None.
Decorative: None.

So there are 5 types of fonts to keep in mind. You may consider searching all the states about which is a more specific method. Or, you may consider training the AI with at least 5 types of each 5 classes mentioned above, which is simpler and universial hack.

I tihnk this might be a simple (but not exact) solution for the 2nd drawback in your conclusion.

Getting error on Unicode fonts

I am trying to use Bangla Unicode font but I am getting this error -

File "d:\toolkits\Anaconda2\lib\site-packages\spyder\utils\site\sitecustomize.py", line 87, in execfile
    exec(compile(scripttext, filename, 'exec'), glob, loc)

  File "D:/Machine Learning/Pet Projects/deep-anpr-master/gen.py", line 296, in <module>
    for img_idx, (im, c, p) in enumerate(im_gen):

  File "D:/Machine Learning/Pet Projects/deep-anpr-master/gen.py", line 287, in generate_ims
    fonts, font_char_ims = load_fonts(FONT_DIR)

  File "D:/Machine Learning/Pet Projects/deep-anpr-master/gen.py", line 275, in load_fonts
    FONT_HEIGHT))

  File "D:/Machine Learning/Pet Projects/deep-anpr-master/gen.py", line 79, in make_char_ims
    im = im.resize((int(width * scale), output_height), Image.ANTIALIAS)

  File "d:\toolkits\Anaconda2\lib\site-packages\PIL\Image.py", line 1546, in resize
    return self.convert('RGBa').resize(size, resample).convert('RGBA')

  File "d:\toolkits\Anaconda2\lib\site-packages\PIL\Image.py", line 1548, in resize
    return self._new(self.im.resize(size, resample))

ValueError: height and width must be > 0

However, I debug the line 79 but found height and width are not less than or equal to zero.

got overfitting when training?

Dear all.

I modify the code to recognise Chinese car plate, and successful train the model. But I can't detect any real car plate, but it worked on test plates which generated by gen.py. Maybe I generate too many test images in the .test/ folder? How many test images should I generate?

Is the model got overfitting? Can I add some real car plate in the test set images to solve this problem, or add a drop out in full connected layer?

Thanks.
(excuse for my English.)

train.py: could not create cudnn handle

My System:
Ubuntu 16.04
Nvidia GeForce GTX 1050 Ti
Driver version 375
CUDA 8.0
cudnn 6.0
compiled tensorflow from sources with compute capabilities 6.1

I'm running into the following issue when running the train.py script:

2017-04-09 10:19:58.319301: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:901] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2017-04-09 10:19:58.319576: I tensorflow/core/common_runtime/gpu/gpu_device.cc:887] Found device 0 with properties: name: GeForce GTX 1050 Ti major: 6 minor: 1 memoryClockRate (GHz) 1.4175 pciBusID 0000:01:00.0 Total memory: 3.94GiB Free memory: 3.90GiB 2017-04-09 10:19:58.319593: I tensorflow/core/common_runtime/gpu/gpu_device.cc:908] DMA: 0 2017-04-09 10:19:58.319599: I tensorflow/core/common_runtime/gpu/gpu_device.cc:918] 0: Y 2017-04-09 10:19:58.319606: I tensorflow/core/common_runtime/gpu/gpu_device.cc:977] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 1050 Ti, pci bus id: 0000:01:00.0) 2017-04-09 10:19:58.357462: I tensorflow/compiler/xla/service/platform_util.cc:58] platform CUDA present with 1 visible devices 2017-04-09 10:19:58.357490: I tensorflow/compiler/xla/service/platform_util.cc:58] platform Host present with 4 visible devices 2017-04-09 10:19:58.357965: I tensorflow/compiler/xla/service/service.cc:183] XLA service 0x38470e0 executing computations on platform Host. Devices: 2017-04-09 10:19:58.357980: I tensorflow/compiler/xla/service/service.cc:191] StreamExecutor device (0): <undefined>, <undefined> 2017-04-09 10:19:58.358132: I tensorflow/compiler/xla/service/platform_util.cc:58] platform CUDA present with 1 visible devices 2017-04-09 10:19:58.358143: I tensorflow/compiler/xla/service/platform_util.cc:58] platform Host present with 4 visible devices 2017-04-09 10:19:58.358574: I tensorflow/compiler/xla/service/service.cc:183] XLA service 0x3840180 executing computations on platform CUDA. Devices: 2017-04-09 10:19:58.358587: I tensorflow/compiler/xla/service/service.cc:191] StreamExecutor device (0): **GeForce GTX 1050 Ti, Compute Capability 6.1** 2017-04-09 10:19:59.687378: E tensorflow/stream_executor/cuda/cuda_dnn.cc:359] could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR 2017-04-09 10:19:59.687419: E tensorflow/stream_executor/cuda/cuda_dnn.cc:326] could not destroy cudnn handle: CUDNN_STATUS_BAD_PARAM 2017-04-09 10:19:59.687428: F tensorflow/core/kernels/conv_ops.cc:659] Check failed: stream->parent()->GetConvolveAlgorithms(&algorithms)

I found several related issues in the tensorflow github repository. I guess that my cudnn v6.0 is the issue here.
Should I just downgrade to cudnn v5.1 or is there another workaround ?

Error with multithreading train.py

Hi, as you know the @mpgen in train.py file is generating some errors, so i commented it. The problem is that it took really long time, i use only CPU tensor flow version (i don't have an NVIDIA gpu, only AMD). For 54k batches it took around 4 days.
Did someone know how to fix the mpgen error?
PS: Excuse my english.

Train.py on Windows

"C:\Program Files\Anaconda3\envs\tensorflow-gpu\python.exe" D:/deep-anpr/train.py
WARNING:tensorflow:From D:/deep-anpr/train.py:184: initialize_all_variables (from tensorflow.python.ops.variables) is deprecated and will be removed after 2017-03-02.
Instructions for updating:
Use tf.global_variables_initializer instead.
2017-05-11 14:18:19.713921: W c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE instructions, but these are available on your machine and could speed up CPU computations.
2017-05-11 14:18:19.714346: W c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE2 instructions, but these are available on your machine and could speed up CPU computations.
2017-05-11 14:18:19.714885: W c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations.
2017-05-11 14:18:19.715274: W c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-05-11 14:18:19.715641: W c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-05-11 14:18:19.715887: W c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-05-11 14:18:20.135785: I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\common_runtime\gpu\gpu_device.cc:887] Found device 0 with properties:
name: GeForce GTX 950
major: 5 minor: 2 memoryClockRate (GHz) 1.266
pciBusID 0000:04:00.0
Total memory: 2.00GiB
Free memory: 1.65GiB
2017-05-11 14:18:20.136117: I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\common_runtime\gpu\gpu_device.cc:908] DMA: 0
2017-05-11 14:18:20.136271: I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\common_runtime\gpu\gpu_device.cc:918] 0: Y
2017-05-11 14:18:20.136449: I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\common_runtime\gpu\gpu_device.cc:977] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 950, pci bus id: 0000:04:00.0)
Traceback (most recent call last):
File "D:/deep-anpr/train.py", line 266, in
initial_weights=initial_weights)
File "D:/deep-anpr/train.py", line 232, in train
test_xs, test_ys = unzip(list(read_data("test/*.png"))[:50])
File "D:/deep-anpr/train.py", line 65, in read_data
code = fname.split("D:\deep-anpr\test")[1][9:16]
IndexError: list index out of range

I try out different setting and a few run, still cannt figure out the problem yet

Can you take a look?

Don't backprop on character probabilities for inputs where the number plate isn't present

Training data contains images where the number plate is too large/too small/not present/truncated. In this case the network should output "0" for the presence parameter, and we don't care what the character outputs are. Currently train.py applies back-propagation to the character outputs for inputs where the plate is not present (in the sense described above). Training could be made more efficient by only backpropping on the presence output in these cases.

weights.npz File

I also dabbling with deep learning. When i trained data , i cant find the weights.npz ,
I don't know if the file is created after the training program, or need me to write my own. If I write my own, before the training is not white ๏ผŸ

Error in training

Hello,

I am following the README and try to train the model on different plate format other than described.
I had changed the number of total characters from 7 to 10 as required by me. But when I do start the training, following error is shown:

Traceback (most recent call last): File "./train.py", line 238, in <module> initial_weights=initial_weights) File "./train.py", line 211, in train do_batch() File "./train.py", line 196, in do_batch do_report() File "./train.py", line 169, in do_report feed_dict={x: test_xs, y_: test_ys}) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 789, in run run_metadata_ptr) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 975, in _run % (np_val.shape, subfeed_t.name, str(subfeed_t.get_shape()))) ValueError: Cannot feed value of shape (50, 325) for Tensor u'Placeholder_1:0', which has shape '(?, 361)'

Also, I am trying to train the model with CPU only, is it possible to do so?

Using Transfer Learning

Is it possible to upload the weights.npz (the weights of the model) somewhere, so I can use Transfer Learning and maybe try to fine tune it?

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.