1、修改bug;
This commit is contained in:
parent
939c4403af
commit
587b660be8
|
@ -21,8 +21,8 @@ minio:
|
||||||
secretAccessKey: OIxv7QptYBO3
|
secretAccessKey: OIxv7QptYBO3
|
||||||
bucket: jky-data
|
bucket: jky-data
|
||||||
node:
|
node:
|
||||||
host: 127.0.0.1
|
host: 192.168.53.10
|
||||||
port: 27188
|
port: 9188
|
||||||
token: 06d36c6f5705507dae778fdce90d0767
|
token: 06d36c6f5705507dae778fdce90d0767
|
||||||
functions:
|
functions:
|
||||||
- name: task-response
|
- name: task-response
|
||||||
|
|
|
@ -260,6 +260,7 @@ func ModelTaskExecuteHandler(payload map[string]interface{}) {
|
||||||
response, err := http.Post(reqUrl, "multipart/form-data", dec)
|
response, err := http.Post(reqUrl, "multipart/form-data", dec)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
config.Logger.With(zap.String("源文件名", f.FileName)).
|
config.Logger.With(zap.String("源文件名", f.FileName)).
|
||||||
|
With(zap.String("请求地址", reqUrl)).
|
||||||
With(zap.String("临时文件名", path.Join(config.Cfg.TmpPath, payload["subDataset"].(string), f.FileName))).
|
With(zap.String("临时文件名", path.Join(config.Cfg.TmpPath, payload["subDataset"].(string), f.FileName))).
|
||||||
Error("文件提交", zap.Error(err))
|
Error("文件提交", zap.Error(err))
|
||||||
}
|
}
|
||||||
|
@ -272,6 +273,7 @@ func ModelTaskExecuteHandler(payload map[string]interface{}) {
|
||||||
body, err := io.ReadAll(response.Body)
|
body, err := io.ReadAll(response.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
config.Logger.With(zap.String("源文件名", f.FileName)).
|
config.Logger.With(zap.String("源文件名", f.FileName)).
|
||||||
|
With(zap.String("请求地址", reqUrl)).
|
||||||
With(zap.String("临时文件名", path.Join(config.Cfg.TmpPath, payload["subDataset"].(string), f.FileName))).
|
With(zap.String("临时文件名", path.Join(config.Cfg.TmpPath, payload["subDataset"].(string), f.FileName))).
|
||||||
Error("模型识别", zap.Error(err))
|
Error("模型识别", zap.Error(err))
|
||||||
}
|
}
|
||||||
|
@ -423,7 +425,7 @@ func ModelTaskExecuteHandler(payload map[string]interface{}) {
|
||||||
//}
|
//}
|
||||||
} else {
|
} else {
|
||||||
reqUrl := fmt.Sprintf("http://127.0.0.1:%s/%s", issue.DstPort, issue.HttpUrl)
|
reqUrl := fmt.Sprintf("http://127.0.0.1:%s/%s", issue.DstPort, issue.HttpUrl)
|
||||||
if len(payload["httpUrl"].(string)) > 0 {
|
if len(payload["httpUrl"].(string)) > 1 {
|
||||||
reqUrl = payload["httpUrl"].(string)
|
reqUrl = payload["httpUrl"].(string)
|
||||||
}
|
}
|
||||||
fc := f["file"].(string)
|
fc := f["file"].(string)
|
||||||
|
@ -438,6 +440,7 @@ func ModelTaskExecuteHandler(payload map[string]interface{}) {
|
||||||
response, err := http.Post(reqUrl, writer.FormDataContentType(), buff)
|
response, err := http.Post(reqUrl, writer.FormDataContentType(), buff)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
config.Logger.With(zap.String("源文件名", f["fileName"].(string))).
|
config.Logger.With(zap.String("源文件名", f["fileName"].(string))).
|
||||||
|
With(zap.String("请求地址", reqUrl)).
|
||||||
With(zap.String("临时文件名", path.Join(config.Cfg.TmpPath, payload["subDataset"].(string), f["fileName"].(string)))).
|
With(zap.String("临时文件名", path.Join(config.Cfg.TmpPath, payload["subDataset"].(string), f["fileName"].(string)))).
|
||||||
Error("文件提交", zap.Error(err))
|
Error("文件提交", zap.Error(err))
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,10 @@ func ProcessWorkflow(payload map[string]interface{}, fc proto.FileCapture, wf *W
|
||||||
case "start-node":
|
case "start-node":
|
||||||
fn, _ := base64.StdEncoding.DecodeString(fc.File)
|
fn, _ := base64.StdEncoding.DecodeString(fc.File)
|
||||||
buff := bytes.NewBuffer(fn)
|
buff := bytes.NewBuffer(fn)
|
||||||
img, imgType, _ = image.Decode(buff)
|
img, imgType, err = image.Decode(buff)
|
||||||
|
if err != nil {
|
||||||
|
goto ReturnPoint
|
||||||
|
}
|
||||||
case "image-node":
|
case "image-node":
|
||||||
//处理图像后
|
//处理图像后
|
||||||
fn := utils.ImageToBuff(img, imgType)
|
fn := utils.ImageToBuff(img, imgType)
|
||||||
|
|
|
@ -171,6 +171,8 @@ func SplitImage(buff *bytes.Buffer, w, h int) []image.Image {
|
||||||
newHeight := int(math.Ceil(float64(img.Bounds().Dy()) / float64(h)))
|
newHeight := int(math.Ceil(float64(img.Bounds().Dy()) / float64(h)))
|
||||||
rect := image.Rect(0, 0, newWidth*w, newHeight*h)
|
rect := image.Rect(0, 0, newWidth*w, newHeight*h)
|
||||||
newImage := image.NewRGBA(rect)
|
newImage := image.NewRGBA(rect)
|
||||||
|
black := color.RGBA{A: 255}
|
||||||
|
draw.Draw(newImage, newImage.Bounds(), &image.Uniform{C: black}, image.Point{}, draw.Src)
|
||||||
draw.Draw(newImage, img.Bounds(), img, newImage.Bounds().Min, draw.Over)
|
draw.Draw(newImage, img.Bounds(), img, newImage.Bounds().Min, draw.Over)
|
||||||
sp := splitPattern(newImage, w, h)
|
sp := splitPattern(newImage, w, h)
|
||||||
spLen := len(sp)
|
spLen := len(sp)
|
||||||
|
|
Loading…
Reference in New Issue