1 Star 0 Fork 0

刘铭/tujiang

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
main.go 1.78 KB
一键复制 编辑 原始数据 按行查看 历史
Liu Ming 提交于 2024-07-06 15:40 . add some model
package main
import (
"gitee.com/extrame/tujiang/http"
"gitee.com/extrame/tujiang/http/ctrl"
"gitee.com/extrame/tujiang/http/ctrl/admin"
"gitee.com/extrame/tujiang/http/model"
"gitee.com/extrame/tujiang/ocr"
"github.com/extrame/goblet"
"github.com/extrame/goblet/plugin"
"github.com/sirupsen/logrus"
//import mordenc sqlite
_ "modernc.org/sqlite"
)
var (
confFile string
image string
imageDir string
useServering bool
port string
debug bool
)
// func init() {
// flag.StringVar(&confFile, "config", "config/conf.yaml", "config from ocr system. If not given, will use default config.")
// flag.StringVar(&image, "image", "", "image to predict. if not given, will use image_dir")
// flag.StringVar(&imageDir, "image_dir", "", "imgs in dir to be predicted. if not given, will check servering")
// flag.BoolVar(&useServering, "use_servering", false, "whether to use ocr server. [default: false]")
// flag.StringVar(&port, "port", "18600", "which port to serve ocr server. [default: 18600].")
// flag.BoolVar(&debug, "debug", false, "whether to use debug mode. [default: false]")
// }
func main() {
server := goblet.Organize("tujiang", plugin.StandardJsonWrapper(plugin.SjwWithSuccessCode(0)), plugin.JWT())
var ocrConfig ocr.Config
var httpConfig http.Config
server.AddConfig("paddle", &ocrConfig)
server.AddConfig("http", &httpConfig)
logrus.Info("Starting OCR server with config...", ocrConfig)
if debug {
logrus.SetLevel(logrus.DebugLevel)
}
sys := ocr.NewOCRSystem(&ocrConfig)
logrus.Info("OCR system has been initialized.", sys)
server.ControlBy(&ctrl.Ocr{
System: sys,
})
server.ControlBy(&admin.User{
Config: &httpConfig,
})
server.ControlBy(&admin.System{
Config: &httpConfig,
})
server.AddModel(&model.User{})
server.Run()
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/extrame/tujiang.git
git@gitee.com:extrame/tujiang.git
extrame
tujiang
tujiang
2.6.0适配

搜索帮助