代码拉取完成,页面将自动刷新
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()
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。