tesstrain.sh doesn't create traindata

17 views
Skip to first unread message

Zohreh Khosrobeygi

unread,
Sep 21, 2018, 4:42:35 AM9/21/18
to tesseract-ocr
Hi,
I had created traindata for persina befor but not my tesstrain.sh doesn't create fas.traindata.
I think this part of bash file doesn't call


make__traineddata() {
  tlog "*****\n=== Making final traineddata file ===*****"
  local lang_prefix=${LANGDATA_ROOT}/${LANG_CODE}/${LANG_CODE}
 

  # Combine available files for this language from the langdata dir.
  if [[ -r ${lang_prefix}.config ]]; then
    tlog "Copying ${lang_prefix}.config to ${TRAINING_DIR}"
    cp ${lang_prefix}.config ${TRAINING_DIR}
    chmod u+w ${TRAINING_DIR}/${LANG_CODE}.config
  fi
  if [[ -r ${lang_prefix}.params-model ]]; then
    tlog "Copying ${lang_prefix}.params-model to ${TRAINING_DIR}"
    cp ${lang_prefix}.params-model ${TRAINING_DIR}
    chmod u+w ${TRAINING_DIR}/${LANG_CODE}.params-model
  fi
  
  # Compose the traineddata file.
  run_command combine_tessdata ${TRAINING_DIR}/${LANG_CODE}.

  # Copy it to the output dir, overwriting only if allowed by the cmdline flag.
  if [[ ! -d ${OUTPUT_DIR} ]]; then
      tlog "Creating new directory ${OUTPUT_DIR}"
      mkdir -p ${OUTPUT_DIR}
  fi
  local destfile=${OUTPUT_DIR}/${LANG_CODE}${namestr}.traineddata;
 
  
  if [[ -f ${destfile} ]] && ((! OVERWRITE)); then
      err_exit "File ${destfile} exists and no --overwrite specified";
  fi
  tlog "Moving ${TRAINING_DIR}/${LANG_CODE}.traineddata to ${OUTPUT_DIR}"
  z=${TRAINING_DIR}/${LANG_CODE}.traineddata

  cp -f ${TRAINING_DIR}/${LANG_CODE}.traineddata ${destfile}
  
}
I reinstalled 
./autogen.sh
./configure
sudo make
sudo make install
sudo ldconfig
sudo make training
sudo make training-install
again and 
 tesseract -v
tesseract 4.0.0-beta.3
 leptonica-1.76.0
  libjpeg 8d (libjpeg-turbo 1.4.2) : libpng 1.2.54 : libtiff 4.0.6 : zlib 1.2.8
 Found AVX2
 Found AVX
 Found SSE
is.
Could you please some one help me?




Reply all
Reply to author
Forward
0 new messages