-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
mac
authored and
mac
committed
Oct 5, 2024
1 parent
83c0ee2
commit 24b4661
Showing
11 changed files
with
369 additions
and
239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
public/ | ||
third_party/ | ||
assets/ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 iFwu | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# 象棋棋盘识别与分析系统 | ||
|
||
这是一个在线象棋棋盘识别与分析系统,可以从上传的图片中识别出象棋棋局,并提供最佳走法分析。 | ||
|
||
## 在线演示 | ||
|
||
您可以在这里体验本系统:[象棋棋盘识别与分析](https://ifwu.github.io/xiangqi-analysis/) | ||
|
||
## 功能特点 | ||
|
||
- 棋盘识别:从上传的图片中自动识别象棋棋盘和棋子位置 | ||
- FEN 生成:根据识别结果生成 FEN(Forsyth–Edwards Notation)字符串 | ||
- 最佳走法分析:使用象棋引擎分析当前局面,给出最佳走法建议 | ||
- 走棋模拟:可以按照建议的最佳走法进行模拟,查看局面变化 | ||
- 中文走法表示:将走法转换为中文表示,方便理解 | ||
- 响应式设计:适配不同尺寸的设备屏幕 | ||
|
||
## 技术栈 | ||
|
||
- 前端框架:Preact | ||
- 图像处理:OpenCV.js | ||
- 象棋引擎:Pikafish(WebAssembly 版本) | ||
- 构建工具:Vite | ||
- 包管理器:pnpm | ||
- 部署:GitHub Pages | ||
|
||
## 本地开发 | ||
|
||
1. 克隆仓库: | ||
|
||
``` | ||
git clone https://github.com/your-username/xiangqi-analysis.git | ||
cd xiangqi-analysis | ||
``` | ||
|
||
2. 安装依赖: | ||
|
||
``` | ||
pnpm install | ||
``` | ||
|
||
3. 启动开发服务器: | ||
|
||
``` | ||
pnpm dev | ||
``` | ||
|
||
4. 在浏览器中打开 `http://localhost:5173` 查看应用 | ||
|
||
## 构建和部署 | ||
|
||
1. 构建项目: | ||
|
||
``` | ||
pnpm build | ||
``` | ||
|
||
2. 部署到 GitHub Pages: | ||
|
||
``` | ||
pnpm deploy | ||
``` | ||
|
||
注意:本项目使用 GitHub Actions 进行自动部署。每次推送到主分支时,都会触发构建和部署流程。 | ||
|
||
## 项目结构 | ||
|
||
- `src/`: 源代码目录 | ||
- `components/`: React 组件 | ||
- `chessboard/`: 棋盘识别和分析相关的模块 | ||
- `public/`: 静态资源目录 | ||
- `vite.config.ts`: Vite 配置文件 | ||
- `.github/workflows/`: GitHub Actions 工作流配置 | ||
|
||
## 贡献 | ||
|
||
欢迎提交 Issues 和 Pull Requests 来改进这个项目! | ||
|
||
## 许可证声明 | ||
|
||
本项目使用 MIT 许可证。 | ||
|
||
本项目使用了 [Pikafish](https://github.com/official-pikafish/Pikafish) 象棋引擎,该引擎采用 GNU General Public License v3.0 (GPL-3.0) 许可证。Pikafish 的版权归其原作者所有。 | ||
|
||
本项目仅调用 Pikafish 引擎,并未对其进行修改。使用本项目不要求您的应用程序遵守 GPL-3.0 许可证。但是,如果您计划重新分发包含 Pikafish 的完整应用程序,请确保遵守 GPL-3.0 许可证的相关规定,包括提供源代码访问和适当的许可声明。 | ||
|
||
完整的 GPL-3.0 许可证文本可在 [此处](https://www.gnu.org/licenses/gpl-3.0.en.html) 查看。 | ||
|
||
使用本项目时,请确保理解并遵守相关的许可条款。如有疑问,建议咨询法律专业人士。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,5 +22,6 @@ | |
"vite": "^5.4.8" | ||
}, | ||
"packageManager": "[email protected]", | ||
"homepage": "https://ifwu.github.io/xiangqi-analysis/" | ||
"homepage": "https://ifwu.github.io/xiangqi-analysis/", | ||
"license": "MIT" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.