Giter Club home page Giter Club logo

ace-translate's Introduction

Ace-Translate

一款本地离线的翻译程序

Features

支持多种翻译场景。

  • 汉译英和英译汉
  • 文本翻译
  • 划词翻译
  • 截图翻译
  • 视频翻译
  • 文件翻译,包括TXT文件、Excel、PPT、PDF、图片和Word
  • 文档图片翻译

INSTALL

推荐使用python3.8+paddlepaddle2.4.0+torch2.0.1

1.拉代码

git clone https://github.com/tianclll/Ace-Translate.git
cd Ace-Translate

2.安装

2.1安装PaddlePaddle

  • GPU

    python3 -m pip install paddlepaddle-gpu==2.4.0 -i https://mirror.baidu.com/pypi/simple
    
  • CPU

    python3 -m pip install paddlepaddle==2.4.0 -i https://mirror.baidu.com/pypi/simple
    

2.2安装依赖

pip install -r requirements.txt
  • Windows需要额外下载
    pip install transformers[sentencepiece]
    pip install clip
    

2.3下载模型文件

点击此处下载

解压后,放入项目文件夹(Ace-Translate)中。

2.4安装Pyaudio

需要运行语音翻译才安装

  • Linux

    sudo apt-get install libasound2-dev
    wget https://files.portaudio.com/archives/pa_stable_v190700_20210406.tgz
    tar -xvf pa_stable_v190700_20210406.tgz
    cd portaudio
    ./configure
    make
    sudo make install
    make clean
    sudo apt-get install python3-pyaudio 
    pip install pyaudio
    
  • Mac

    sudo brew install libasound2-dev
    wget https://files.portaudio.com/archives/pa_stable_v190700_20210406.tgz
    tar -xvf pa_stable_v190700_20210406.tgz
    cd portaudio
    ./configure
    make
    sudo make install
    make clean
    pip install pyaudio
    
  • Windows

    pip install pipwin
    pipwin install pyaudio
    

2.5安装ImageMagick

需要运行视频翻译才安装 官网下载地址

3.设置

修改config.conf文件:

  • 设置快捷键
  • 设置运行设备 gpu or cpu

4.运行

注意:第一次语音翻译模块都需要连网

python main.py

效果展示

有"划词翻译","截图翻译","PDF翻译","文档图片翻译"四个功能,项目运行后会挂载到状态栏上,点击"x"时不会退出只是隐藏,点击状态栏上的"打开",就会弹出,点击状态栏上的"退出",才是真正的退出程序。(Ubuntu18.04及以后默认无状态栏)

文本翻译

文本翻译

划词翻译

  • 选择"汉译英"或者"英译汉",然后点击开始
  • 然后鼠标选中想要翻译的内容,点击复制
  • 按下设置的快捷键,就能翻译了

划词翻译

截图翻译

截图翻译

语音翻译

支持音频文件和语音录入

语音翻译

视频翻译

支持输出srt字幕文件和视频

视频翻译 视频翻译

文件翻译

  • TXT

TXT文件翻译 TXT文件翻译

  • PDF

PDF文件翻译 PDF文件翻译

  • Excel

Excel文件翻译 Excel文件翻译

  • Word

Word文件翻译 Word文件翻译

文档图片翻译

文档图片翻译 文档图片翻译

第三方开源软件

本项目使用了以下基于 Apache 许可证,版本 2.0 的第三方开源软件:

LICENSE

本项目的发布受Apache 2.0 license许可认证。

Copyright (c) 2023 tianclll

ace-translate's People

Contributors

tianclll avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.