Skip to content

Commit

Permalink
Merge pull request tesseract-ocr#2614 from stweil/training
Browse files Browse the repository at this point in the history
Move source files which are used for training only to src/training
  • Loading branch information
egorpugin authored Aug 12, 2019
2 parents 23afe83 + e84cb24 commit 73f7135
Show file tree
Hide file tree
Showing 22 changed files with 46 additions and 23 deletions.
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,7 @@ include_directories(src/opencl)
include_directories(src/textord)
include_directories(src/viewer)
include_directories(src/wordrec)
if(CMAKE_EXPORT_COMPILE_COMMANDS)
include_directories(src/training)
endif()
include_directories(src/training)
if(ANDROID_TOOLCHAIN)
include_directories(${ANDROID_TOOLCHAIN}/sysroot/usr/include)
add_compile_definitions(__ANDROID_API_FUTURE__)
Expand Down
18 changes: 4 additions & 14 deletions src/classify/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ AM_CPPFLAGS += \
-I$(top_srcdir)/src/ccutil \
-I$(top_srcdir)/src/ccstruct \
-I$(top_srcdir)/src/dict \
-I$(top_srcdir)/src/training \
-I$(top_srcdir)/src/viewer

if DISABLED_LEGACY_ENGINE
Expand All @@ -23,16 +24,13 @@ noinst_HEADERS += \
adaptive.h \
cluster.h \
clusttool.h \
errorcounter.h \
featdefs.h \
float2int.h \
fpoint.h \
intfeaturedist.h \
intfeaturemap.h \
intfeaturespace.h \
intfx.h intmatcher.h \
intproto.h kdtree.h \
mastertrainer.h mf.h \
mf.h \
mfdefs.h \
mfoutline.h \
mfx.h \
Expand All @@ -42,12 +40,10 @@ noinst_HEADERS += \
outfeat.h \
picofeat.h \
protos.h \
sampleiterator.h \
shapeclassifier.h \
shapetable.h \
tessclassifier.h \
trainingsample.h \
trainingsampleset.h
trainingsample.h
endif

noinst_LTLIBRARIES = libtesseract_classify.la
Expand All @@ -63,18 +59,14 @@ libtesseract_classify_la_SOURCES += \
cluster.cpp \
clusttool.cpp \
cutoffs.cpp \
errorcounter.cpp \
featdefs.cpp \
float2int.cpp \
fpoint.cpp \
intfeaturedist.cpp \
intfeaturemap.cpp \
intfeaturespace.cpp \
intfx.cpp \
intmatcher.cpp \
intproto.cpp \
kdtree.cpp \
mastertrainer.cpp \
mf.cpp mfdefs.cpp \
mfoutline.cpp \
mfx.cpp \
Expand All @@ -84,10 +76,8 @@ libtesseract_classify_la_SOURCES += \
outfeat.cpp \
picofeat.cpp \
protos.cpp \
sampleiterator.cpp \
shapeclassifier.cpp \
shapetable.cpp \
tessclassifier.cpp \
trainingsample.cpp \
trainingsampleset.cpp
trainingsample.cpp
endif
8 changes: 4 additions & 4 deletions src/lstm/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ endif

pkginclude_HEADERS =

noinst_HEADERS = convolve.h ctc.h
noinst_HEADERS = convolve.h
noinst_HEADERS += fullyconnected.h functions.h input.h
noinst_HEADERS += lstm.h lstmrecognizer.h maxpool.h
noinst_HEADERS += network.h networkbuilder.h networkio.h networkscratch.h
noinst_HEADERS += network.h networkio.h networkscratch.h
noinst_HEADERS += parallel.h plumbing.h recodebeam.h reconfig.h reversed.h
noinst_HEADERS += series.h static_shape.h stridemap.h
noinst_HEADERS += tfnetwork.h weightmatrix.h

noinst_LTLIBRARIES = libtesseract_lstm.la

libtesseract_lstm_la_SOURCES = \
convolve.cpp ctc.cpp fullyconnected.cpp functions.cpp input.cpp \
convolve.cpp fullyconnected.cpp functions.cpp input.cpp \
lstm.cpp lstmrecognizer.cpp maxpool.cpp \
networkbuilder.cpp network.cpp networkio.cpp \
network.cpp networkio.cpp \
parallel.cpp plumbing.cpp recodebeam.cpp reconfig.cpp reversed.cpp \
series.cpp stridemap.cpp tfnetwork.cpp weightmatrix.cpp

Expand Down
16 changes: 16 additions & 0 deletions src/training/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,22 @@ set(common_training_src
commandlineflags.h
commontraining.cpp
commontraining.h
ctc.cpp
ctc.h
errorcounter.cpp
errorcounter.h
intfeaturedist.cpp
intfeaturedist.h
intfeaturemap.cpp
intfeaturemap.h
mastertrainer.cpp
mastertrainer.h
networkbuilder.cpp
networkbuilder.h
sampleiterator.cpp
sampleiterator.h
trainingsampleset.cpp
trainingsampleset.h
)
add_library (common_training ${common_training_src})
target_link_libraries (common_training libtesseract tessopt)
Expand Down
19 changes: 19 additions & 0 deletions src/training/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ noinst_HEADERS = \
boxchar.h \
commandlineflags.h \
commontraining.h \
ctc.h \
degradeimage.h \
icuerrorcode.h \
fileio.h \
lang_model_helpers.h \
ligature_table.h \
lstmtester.h \
lstmtrainer.h \
networkbuilder.h \
normstrngs.h \
pango_font_info.h \
stringrenderer.h \
Expand All @@ -54,7 +56,13 @@ noinst_HEADERS = \
validator.h

if !DISABLED_LEGACY_ENGINE
noinst_HEADERS += errorcounter.h
noinst_HEADERS += intfeaturedist.h
noinst_HEADERS += intfeaturemap.h
noinst_HEADERS += mastertrainer.h
noinst_HEADERS += mergenf.h
noinst_HEADERS += sampleiterator.h
noinst_HEADERS += trainingsampleset.h
endif


Expand All @@ -68,13 +76,15 @@ libtesseract_training_la_SOURCES = \
boxchar.cpp \
commandlineflags.cpp \
commontraining.cpp \
ctc.cpp \
degradeimage.cpp \
icuerrorcode.cpp \
fileio.cpp \
lang_model_helpers.cpp \
ligature_table.cpp \
lstmtester.cpp \
lstmtrainer.cpp \
networkbuilder.cpp \
normstrngs.cpp \
pango_font_info.cpp \
stringrenderer.cpp \
Expand All @@ -87,6 +97,15 @@ libtesseract_training_la_SOURCES = \
validate_myanmar.cpp \
validator.cpp

if !DISABLED_LEGACY_ENGINE
libtesseract_training_la_SOURCES += errorcounter.cpp
libtesseract_training_la_SOURCES += intfeaturedist.cpp
libtesseract_training_la_SOURCES += intfeaturemap.cpp
libtesseract_training_la_SOURCES += mastertrainer.cpp
libtesseract_training_la_SOURCES += sampleiterator.cpp
libtesseract_training_la_SOURCES += trainingsampleset.cpp
endif

libtesseract_tessopt_la_SOURCES = \
tessopt.cpp

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions unittest/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ indexmapbidi_test_SOURCES = indexmapbidi_test.cc
indexmapbidi_test_LDADD = $(TRAINING_LIBS)

intfeaturemap_test_SOURCES = intfeaturemap_test.cc
intfeaturemap_test_LDADD = $(TESS_LIBS)
intfeaturemap_test_LDADD = $(TRAINING_LIBS)

intsimdmatrix_test_SOURCES = intsimdmatrix_test.cc
intsimdmatrix_test_LDADD = $(TESS_LIBS)
Expand Down Expand Up @@ -303,7 +303,7 @@ lstmtrainer_test_SOURCES = lstmtrainer_test.cc
lstmtrainer_test_LDADD = $(ABSEIL_LIBS) $(TRAINING_LIBS) $(LEPTONICA_LIBS)

mastertrainer_test_SOURCES = mastertrainer_test.cc
mastertrainer_test_LDADD = $(ABSEIL_LIBS) $(TRAINING_LIBS)
mastertrainer_test_LDADD = $(ABSEIL_LIBS) $(TRAINING_LIBS) $(LEPTONICA_LIBS)

matrix_test_SOURCES = matrix_test.cc
matrix_test_LDADD = $(TESS_LIBS)
Expand Down

0 comments on commit 73f7135

Please sign in to comment.