Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

English | 한국어 | 日本語 | Tiếng Việt

Go example

https://github.com/bobhyun/TS-ANPR/tree/main/examples/Go/anpr

1. Copying the Engine Files

[Note] In this example, the engine file is extracted to the examples/bin/ directory to share it with other examples. However, for actual deployment, the engine file is typically copied to the directory where the application's executable file is located.

  • For Windows x86 64-bit Extract the engine file to the examples/bin/windows-x86_64 directory
    7z x tsanpr*-windows-x86_64.7z
  • For Windows x86 32-bit Extract the engine file to the examples/bin/windows-x86 directory
    7z x tsanpr*-windows-x86.7z
  • For Linux x86 64-bit Extract the engine file to the examples/bin/linux-x86_64 directory
    tar xvf tsanpr-linux-x86_64.tar.xz
  • For Linux arm 64-bit Extract the engine file to the examples/bin/linux-aarch64 directory
    tar xvf tsanpr-linux-aarch64.tar.xz
  • Directory structure
    examples
    ├── bin
    │   ├─── windows-x86_64        # engine directory for windows (x86_64)
    │   │   ├── libtsanpr.so
    │   │   ├── tsanpr-2505M.eon
    │   │   └── tshelper
    │   ├── linux-x86_64           # engine directory for linux (x86_64)
    │   │   ├── libtsanpr.so
    │   │   ├── tsanpr-2505M.eon
    │   │   └── tshelper
    │   └── linux-aarch64          # engine directory for linux (arm64)
    │       ├── libtsanpr.so
    │       ├── tsanpr-2505M.eon
    │       └── tshelper
    ├── img                        # image directory
    └── Go
        └── anpr                   # source directory
           ├── anpr                # compiled executable for Windows
           ├── anpr.exe            # compiled executable for Linux
           ├── go.mod
           ├── main.go
           └── tsanpr
              ├── tsanpr_windows.go
              └── tsanpr_linux.go

2. Build and Run

2.1 Windows (MinGW)

  1. Module Initialzation

    go mod tidy
  2. Dependency Installation

  3. How to Build

    go build -o anpr.exe main.go
  4. How to Run

    .\anpr.exe

2.2. Linux

  1. Module Initialzation

    go mod tidy
  2. Dependency Installation

    • Debian / Ubuntu Linux

      sudo apt install -y build-essential g++ libopencv-dev
    • Oracle Linux / RedHat (RHEL) / CentOS

      sudo def install -y epel-release gcc gcc-c++ opencv opencv-devel
  3. How to Build

    go build -o anpr main.go
  4. How to Run

    ./anpr