Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
licenseplates
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Taddeüs Kroes
licenseplates
Commits
f82f3ffa
Commit
f82f3ffa
authored
13 years ago
by
Taddeus Kroes
Browse files
Options
Downloads
Patches
Plain Diff
Filled in Scripts section.
parent
957cba5c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/report.tex
+43
-35
43 additions, 35 deletions
docs/report.tex
with
43 additions
and
35 deletions
docs/report.tex
+
43
−
35
View file @
f82f3ffa
...
...
@@ -352,63 +352,71 @@ it as good as possible because all occurrences are in the learning set.
To be able to use the code efficiently, we wrote a number of scripts. This
section describes the purpose and usage of each script. For each script it is
essential that you use the correct folder and subfolder naming scheme. The
scheme
is as follows:
essential that you use the correct folder and subfolder naming scheme. The
scheme
is as follows:
\begin{enumerate}
\item
A main folder called `images' placed in the current directory as the
src folder.
\item
A main folder called `images' placed in the root directory.
\item
In the images folder there have to be three folders. Images, Infos
and LearningSet.
\item
The Images and Infos folder contain sub
folder
s which are numbered
characters
\item
The Images and Infos folder contain sub
directorie
s which are numbered
(
$
0001
$
to possibly
$
9999
$
).
\item
In each of the sub
folder
s the data (i.e the images or xml files)
can
be placed.
And have to be named
$
00991
_
XXXXX.ext
$
, where XXXXX can be
\item
In each of the sub
directorie
s the data (i.e the images or xml files)
can
be placed. And have to be named
$
00991
_
XXXXX.ext
$
, where XXXXX can be
$
00000
to
99999
$
.
\item
For-loops in the script currently only go up to 9 sub
folders, with a
maximum of containing 100 images or xml files. These numbers have to
be
adjusted if the scripts are being used, but with a bigger dataset.
\item
For-loops in the script currently only go up to 9 sub
directories,
with a
maximum of containing 100 images or xml files. These numbers have to
be
adjusted if the scripts are being used, but with a bigger dataset.
\end{enumerate}
It is of course possible to use your own naming scheme. A search for the
$
filename
$
variable will most likely find the occurences where the naming
scheme is implemented.
\subsection*
{
\texttt
{
create
\_
characters.py
}}
Generates a file containing character objects with their feature vectors. Also,
the learning set and test set files are created for the given combination of
NEIGHBOURS and BLUR
\_
SCALE.
\subsection*
{
\texttt
{
create
\_
classifier.py
}}
Generates a file containing a classifier object for the given combination of
NEIGHBOURS and BLUR
\_
SCALE. The script uses functions from
\texttt
{
create
\_
characters.py
}
to ensure that the required character files
exist first. Therefore,
\texttt
{
create
\_
characters.py
}
does not need to
executed manually first.
\subsection*
{
\texttt
{
find
\_
svm
\_
params.py
}}
Performs a grid-search to find the optimal value for
\texttt
{
c
}
and
\texttt
{
gamma
}
, for the given combination of NEIGHBOURS and BLUR
\_
SCALE. The
optimal classifier is saved in
\emph
{
data/classifier
\_\{
BLUR
\_
SCALE
\}\_\{
NEIGBOURS
\}
.dat
}
, and the accuracy
scores are saved in in
\emph
{
results/results
\_\{
BLUR
\_
SCALE
\}\_\{
NEIGBOURS
\}
.txt
}
.
Like
\texttt
{
create
\_
classifier.py
}
, the script ensures that the required
character object files exist first.
\subsection*
{
\texttt
{
run
\_
classifier.py
}}
Runs the classifier that has been saved in
\emph
{
data/classifier
\_\{
BLUR
\_
SCALE
\}\_\{
NEIGBOURS
\}
.dat
}
. If the classifier
file does not exist yet, a C and GAMMA can be specified so that it is created.
Therefore, it is not necessary to run
\texttt
{
create
\_
classifier.py
}
first.
\subsection*
{
\texttt
{
generate
\_
learning
\_
set.py
}}
Usage of this script could be minimal, since you only need to extract the
letters carefully and succesfully once. Then other scripts in this list can
use
the extracted images. Most likely the other scripts will use caching to
speed
up the system to. But in short, the script will create images of a single
letters carefully and succes
s
fully once. Then other scripts in this list can
use
the extracted images. Most likely the other scripts will use caching to
speed
up the system to. But in short, the script will create images of a single
character based on a given dataset of license plate images and corresponding
xml
files. If the
xml
files give correct locations of the characters they can
be extracted. The workhorse of this script is
$
plate
=
xml
_
to
_
LicensePlate
(
filename, save
_
character
=
1
)
$
. Where
XML
files. If the
XML
files give correct locations of the characters they can
be extracted. The workhorse of this script is
\texttt
{
plate =
xml
\
_
to
\
_
LicensePlate(filename, save
\
_
character=1)
}
. Where
\texttt
{
save
\_
character
}
is an optional variable. If set it will save the image
in the LearningSet folder and pick the correct subfolder based on the character
value. So if the XML says a character is an 'A' it will be placed in the 'A'
folder. These folders will be created automatically if they do not exist yet.
\subsection*
{
\texttt
{
load
\_
learning
\_
set.py
}}
\subsection*
{
\texttt
{
run
\_
classifier.py
}}
in the characters folder and pick the correct subdirectory based on the
character value. So if the XML says a character is an 'A' it will be placed in
the `A' folder. These folders will be created automatically if they do not
exist yet.
\section
{
Finding parameters
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment