openalpr / train-detector

Input files and scripts necessary to train the license plate detector.
GNU Affero General Public License v3.0
125 stars 166 forks source link

python script error #6

Closed khlitoshi closed 9 years ago

khlitoshi commented 9 years ago

Hi, I've several error running the the python prep.py script on windows 7 using python 2.7.9. error 1, "from PIL import Image" => the module name incorrect. changed it from "from pil import Image" to "import image", but still the module Image is unknown.

error 2 is related to directory paths. original path in script was: "/home/mhill/projects/alpr/samples/training/" I changed it to: "C:\trainer" and I get error when the script concatenates it in the following instruction: INPUT_NEGATIVE_DIR = BASEDIR + 'raw-neg/' by giving this wrong result: "C:\trainerraw-neg/._" I changed it to: "C:\trainer\" and the error is: syntax error: EOL while scanning string literal

seems like the script is written for unix-based system. can anyone please help?

khlitoshi commented 9 years ago

error 2 is solved. python uses unix-based paths, with 'c:\' considered as '/' error 1 could not solve. need help please.

khlitoshi commented 9 years ago

Error 1 finally solved by the following:

  1. install Python 2.7.0
  2. install Image library from http://www.pythonware.com/products/pil/ (http://effbot.org/media/downloads/PIL-1.1.7.win32-py2.7.exe)
  3. replace "from PIL import Image" by "import Image"
zhouhao27 commented 6 years ago

Got the error:

File "./prep.py", line 4, in from PIL import Image

My version of python is 3.6