- Download the MaaFramework Release
- Prepare Resource Files
- Use a Generic CLI or Write Integration Code
Download and extract the MaaFramework release that matches your platform: Releases
You need to prepare some resource files with the typical file structure as follows:
my_resource
├── image
│ ├── my_image_1.png
│ └── my_image_2.png
├── model
│ └── ocr
│ ├── det.onnx
│ ├── keys.txt
│ └── rec.onnx
└── pipeline
├── my_pipeline_1.json
└── my_pipeline_2.json
You can modify the names of files and folders starting with "my_", but the others have fixed file names and should not be changed. Here's a breakdown:
The files in my_resource/pipeline
contain the main script execution logic and recursively read all JSON format files in the directory.
You can refer to the Task Pipeline Protocol for writing these files. You can find a simple demo for reference.
Tools:
The files in my_resource/image
are primarily used for template matching images, feature detection images, and other images required by the pipeline. They are read based on the template
and other fields specified in the pipeline.
Tools:
The files in my_resource/model/ocr
are ONNX models obtained from PaddleOCR after conversion.
You can use our pre-converted files: MaaCommonAssets. Choose the language you need and store them according to the directory structure mentioned above in Prepare Resource Files.
If needed, you can also fine-tune the official pre-trained models of PaddleOCR yourself (please refer to the official PaddleOCR documentation) and convert them to ONNX files for use. You can find conversion commands here.
You can integrate MaaFramework using MaaPiCli (Generic CLI) or by writing integration code yourself.
Use MaaPiCli in the bin
folder of the Release package, and write interface.json
and place it in the same directory to use it.
The Cli has completed basic function development, and more functions are being continuously improved! Detailed documentation needs to be further improved. Currently, you can refer to sample to write it.
Examples:
Please refer to the Integration Documentation.
Examples: