-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimageEnhance.go
More file actions
36 lines (31 loc) · 758 Bytes
/
imageEnhance.go
File metadata and controls
36 lines (31 loc) · 758 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package GoDeepStack
import (
"fmt"
"github.com/aavgoust02/GoDeepStack/util"
)
type ImageEnhancer struct {
*AbstractDetector
client *DeepStack
ImagePath string
}
type Image struct {
Success bool `json:"success"`
Base64 string `json:"base64"`
Width int `json:"width"`
Height int `json:"height"`
}
func (ie *ImageEnhancer) Endpoint() string {
c := ie.AbstractDetector.Client
protocol := "http"
if c.SSL {
protocol = "https"
}
return fmt.Sprintf("%s://%s:%d/v1/vision/enhance", protocol, c.Addr, c.Port)
}
func (ie *ImageEnhancer) Enhance(imagePath string) *Image {
files := util.NewEmptyFiles()
files.Files["image"] = imagePath
var result *Image
ie.SendRequest(files, util.NewEmptyParameters(), &result)
return result
}