From 24e32039446f292010002b5e146d527096e6ac94 Mon Sep 17 00:00:00 2001 From: Dimitrii Date: Tue, 7 Jul 2020 13:58:29 +0300 Subject: [PATCH] separate protobuff --- cmd/server/main.go | 17 +- go.mod | 15 +- go.sum | 59 ++----- yolo_grpc.pb.go | 404 --------------------------------------------- yolo_grpc.proto | 37 ----- 5 files changed, 26 insertions(+), 506 deletions(-) delete mode 100644 yolo_grpc.pb.go delete mode 100644 yolo_grpc.proto diff --git a/cmd/server/main.go b/cmd/server/main.go index 504a8dc..2111c32 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -7,12 +7,13 @@ import ( "fmt" "image" "image/jpeg" - engine "license_plate_recognition" "log" "net" "os" "time" + engine "github.com/LdDl/license_plate_recognition" + grpc_server "github.com/LdDl/odam" "github.com/disintegration/imaging" "google.golang.org/grpc" ) @@ -69,7 +70,7 @@ func main() { grpcInstance := grpc.NewServer() // Register servers - engine.RegisterSTYoloServer( + grpc_server.RegisterSTYoloServer( grpcInstance, rs, ) @@ -84,7 +85,7 @@ func main() { // RecognitionServer Wrapper around engine.STYoloServer type RecognitionServer struct { - engine.STYoloServer + grpc_server.STYoloServer netW *engine.YOLONetwork framesQueue chan *vehicleInfo maxLen int @@ -169,13 +170,13 @@ type vehicleInfo struct { } // SendDetection Imeplented function or accepting image -func (rs *RecognitionServer) SendDetection(ctx context.Context, in *engine.CamInfo) (*engine.Response, error) { +func (rs *RecognitionServer) SendDetection(ctx context.Context, in *grpc_server.CamInfo) (*grpc_server.Response, error) { imgBytes := in.GetImage() imgReader := bytes.NewReader(imgBytes) stdImage, _, err := image.Decode(imgReader) if err != nil { - return &engine.Response{Error: "Image decoding failed"}, err + return &grpc_server.Response{Error: "Image decoding failed"}, err } height := stdImage.Bounds().Dy() @@ -187,7 +188,7 @@ func (rs *RecognitionServer) SendDetection(ctx context.Context, in *engine.CamIn dh := int(det.GetHeight()) dw := int(det.GetWidth()) if dw <= 0 || dh <= 0 || xl >= width || yt >= height { - return &engine.Response{Error: "Incorrect bounding box of a car"}, nil + return &grpc_server.Response{Error: "Incorrect bounding box of a car"}, nil } bbw := xl + dw @@ -220,9 +221,9 @@ func (rs *RecognitionServer) SendDetection(ctx context.Context, in *engine.CamIn response := <-rs.resp log.Println(response.Resp.String()) if response.Error != nil { - return &engine.Response{Message: "error", Warning: response.Error.Error()}, nil + return &grpc_server.Response{Message: "error", Warning: response.Error.Error()}, nil } - return &engine.Response{Message: "ok", Warning: ""}, nil + return &grpc_server.Response{Message: "ok", Warning: ""}, nil } func ensureDir(dirName string) error { diff --git a/go.mod b/go.mod index 6ac2bbe..349ab06 100644 --- a/go.mod +++ b/go.mod @@ -1,16 +1,13 @@ -module license_plate_recognition +module github.com/LdDl/license_plate_recognition -go 1.13 +go 1.14 require ( github.com/LdDl/go-darknet v1.1.0 + github.com/LdDl/gocv-blob v1.0.1 // indirect + github.com/LdDl/odam v0.2.0 github.com/disintegration/imaging v1.6.2 - github.com/golang/protobuf v1.4.2 - golang.org/x/image v0.0.0-20200618115811-c13761719519 // indirect - golang.org/x/net v0.0.0-20200625001655-4c5254603344 - golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4 // indirect - golang.org/x/text v0.3.3 // indirect - google.golang.org/genproto v0.0.0-20200624020401-64a14ca9d1ad // indirect + github.com/satori/go.uuid v1.2.0 // indirect + gocv.io/x/gocv v0.23.0 // indirect google.golang.org/grpc v1.30.0 - google.golang.org/protobuf v1.25.0 // indirect ) diff --git a/go.sum b/go.sum index ba585c0..a8b45cc 100644 --- a/go.sum +++ b/go.sum @@ -1,16 +1,19 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/LdDl/go-darknet v0.0.0-20200324085007-4c39be01f962 h1:aQgc3yXRBamfhPGvy+twcCYC1Uz5knHMo4ikR894JDk= -github.com/LdDl/go-darknet v0.0.0-20200324085007-4c39be01f962/go.mod h1:vNpwlxHd2mevaqWDYG9r/ABi1+cQrXw0HUuSPaDKuD8= github.com/LdDl/go-darknet v1.1.0 h1:oWz93jTcAv060dngpEgVtN9TeX5+KDTdB9Aef1CnBxI= github.com/LdDl/go-darknet v1.1.0/go.mod h1:vNpwlxHd2mevaqWDYG9r/ABi1+cQrXw0HUuSPaDKuD8= +github.com/LdDl/gocv-blob v1.0.1 h1:BowqNyVrkN7W//N9+rkVYGWiMjd82UnzFhYlJt3cxHc= +github.com/LdDl/gocv-blob v1.0.1/go.mod h1:PdvuCxFbzOgjuz81sVmq4FzZ4GJ7xVpP3narVHe5nio= +github.com/LdDl/odam v0.1.0 h1:bcazpbwiuHwTpznSPE8TSlhgv1aYG42FZrEBY5NulHo= +github.com/LdDl/odam v0.1.0/go.mod h1:7DiFwy7yNK0DR2Afoo7YDjq0C4L03TrHtIieeEc6ydQ= +github.com/LdDl/odam v0.2.0 h1:u1O6abC0lKuJX7iUIJPsrfIbEjrrwN7ard26jT2bsgE= +github.com/LdDl/odam v0.2.0/go.mod h1:7DiFwy7yNK0DR2Afoo7YDjq0C4L03TrHtIieeEc6ydQ= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/disintegration/imaging v1.6.2 h1:w1LecBlG2Lnp8B3jk5zSuNqd7b4DXhcjwek1ei82L+c= github.com/disintegration/imaging v1.6.2/go.mod h1:44/5580QXChDfwIclfc/PCwrr44amcmDAg8hxG0Ewe4= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -19,28 +22,17 @@ github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= +github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +gocv.io/x/gocv v0.23.0 h1:3Fgbt06/uR8Zf9emWndhjbUjdrw+nto69R/b4noFydY= +gocv.io/x/gocv v0.23.0/go.mod h1:Rar2PS6DV+T4FL+PM535EImD/h13hGVaHhnCu1xarBs= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8 h1:hVwzHzIUGRjiF7EcUjqNxk3NCfkPxbDKRdnNE1Rpg0U= golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20200119044424-58c23975cae1 h1:5h3ngYt7+vXCDZCup/HkCQgW5XwmSvR/nA2JmJ0RErg= -golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20200618115811-c13761719519 h1:1e2ufUJNM3lCHEY5jIgac/7UTjd6cgJNdatjPdFWf34= -golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -49,9 +41,6 @@ golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20200625001655-4c5254603344 h1:vGXIOMxbNfDTk/aXCmfdLgkrSV+Z2tcbze+pEc3v5W4= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -59,16 +48,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4 h1:5/PjkGUjvEU5Gl6BxmvKRPpqo2uNMv4rcHBMwzk/st8= -golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -79,28 +60,10 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200624020401-64a14ca9d1ad h1:uAwc13+y0Y8QZLTYhLCu6lHhnG99ecQU5FYTj8zxAng= -google.golang.org/genproto v0.0.0-20200624020401-64a14ca9d1ad/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.1 h1:C1QC6KzgSiLyBabDi87BbjaGreoRgGUF5nOyvfrAZ1k= -google.golang.org/grpc v1.28.1/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.30.0 h1:M5a8xTlYTxwMn5ZFkwhRabsygDY5G8TYLyQDBxJNAxE= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/yolo_grpc.pb.go b/yolo_grpc.pb.go deleted file mode 100644 index 0e95caa..0000000 --- a/yolo_grpc.pb.go +++ /dev/null @@ -1,404 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: yolo_grpc.proto - -package license_plate_recognition - -import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type CamInfo struct { - CamId string `protobuf:"bytes,1,opt,name=cam_id,json=camId,proto3" json:"cam_id,omitempty"` - Timestamp int64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Image []byte `protobuf:"bytes,3,opt,name=image,proto3" json:"image,omitempty"` - Detection *Detection `protobuf:"bytes,4,opt,name=detection,proto3" json:"detection,omitempty"` - VirtualLine *VirtualLineInfo `protobuf:"bytes,5,opt,name=virtual_line,json=virtualLine,proto3" json:"virtual_line,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CamInfo) Reset() { *m = CamInfo{} } -func (m *CamInfo) String() string { return proto.CompactTextString(m) } -func (*CamInfo) ProtoMessage() {} -func (*CamInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_ffa770372640e731, []int{0} -} - -func (m *CamInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CamInfo.Unmarshal(m, b) -} -func (m *CamInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CamInfo.Marshal(b, m, deterministic) -} -func (m *CamInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_CamInfo.Merge(m, src) -} -func (m *CamInfo) XXX_Size() int { - return xxx_messageInfo_CamInfo.Size(m) -} -func (m *CamInfo) XXX_DiscardUnknown() { - xxx_messageInfo_CamInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_CamInfo proto.InternalMessageInfo - -func (m *CamInfo) GetCamId() string { - if m != nil { - return m.CamId - } - return "" -} - -func (m *CamInfo) GetTimestamp() int64 { - if m != nil { - return m.Timestamp - } - return 0 -} - -func (m *CamInfo) GetImage() []byte { - if m != nil { - return m.Image - } - return nil -} - -func (m *CamInfo) GetDetection() *Detection { - if m != nil { - return m.Detection - } - return nil -} - -func (m *CamInfo) GetVirtualLine() *VirtualLineInfo { - if m != nil { - return m.VirtualLine - } - return nil -} - -type Detection struct { - XLeft int32 `protobuf:"varint,1,opt,name=x_left,json=xLeft,proto3" json:"x_left,omitempty"` - YTop int32 `protobuf:"varint,2,opt,name=y_top,json=yTop,proto3" json:"y_top,omitempty"` - Height int32 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` - Width int32 `protobuf:"varint,4,opt,name=width,proto3" json:"width,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Detection) Reset() { *m = Detection{} } -func (m *Detection) String() string { return proto.CompactTextString(m) } -func (*Detection) ProtoMessage() {} -func (*Detection) Descriptor() ([]byte, []int) { - return fileDescriptor_ffa770372640e731, []int{1} -} - -func (m *Detection) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Detection.Unmarshal(m, b) -} -func (m *Detection) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Detection.Marshal(b, m, deterministic) -} -func (m *Detection) XXX_Merge(src proto.Message) { - xxx_messageInfo_Detection.Merge(m, src) -} -func (m *Detection) XXX_Size() int { - return xxx_messageInfo_Detection.Size(m) -} -func (m *Detection) XXX_DiscardUnknown() { - xxx_messageInfo_Detection.DiscardUnknown(m) -} - -var xxx_messageInfo_Detection proto.InternalMessageInfo - -func (m *Detection) GetXLeft() int32 { - if m != nil { - return m.XLeft - } - return 0 -} - -func (m *Detection) GetYTop() int32 { - if m != nil { - return m.YTop - } - return 0 -} - -func (m *Detection) GetHeight() int32 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *Detection) GetWidth() int32 { - if m != nil { - return m.Width - } - return 0 -} - -type VirtualLineInfo struct { - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - LeftX int32 `protobuf:"varint,2,opt,name=left_x,json=leftX,proto3" json:"left_x,omitempty"` - LeftY int32 `protobuf:"varint,3,opt,name=left_y,json=leftY,proto3" json:"left_y,omitempty"` - RightX int32 `protobuf:"varint,4,opt,name=right_x,json=rightX,proto3" json:"right_x,omitempty"` - RightY int32 `protobuf:"varint,5,opt,name=right_y,json=rightY,proto3" json:"right_y,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *VirtualLineInfo) Reset() { *m = VirtualLineInfo{} } -func (m *VirtualLineInfo) String() string { return proto.CompactTextString(m) } -func (*VirtualLineInfo) ProtoMessage() {} -func (*VirtualLineInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_ffa770372640e731, []int{2} -} - -func (m *VirtualLineInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VirtualLineInfo.Unmarshal(m, b) -} -func (m *VirtualLineInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VirtualLineInfo.Marshal(b, m, deterministic) -} -func (m *VirtualLineInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_VirtualLineInfo.Merge(m, src) -} -func (m *VirtualLineInfo) XXX_Size() int { - return xxx_messageInfo_VirtualLineInfo.Size(m) -} -func (m *VirtualLineInfo) XXX_DiscardUnknown() { - xxx_messageInfo_VirtualLineInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_VirtualLineInfo proto.InternalMessageInfo - -func (m *VirtualLineInfo) GetId() int32 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *VirtualLineInfo) GetLeftX() int32 { - if m != nil { - return m.LeftX - } - return 0 -} - -func (m *VirtualLineInfo) GetLeftY() int32 { - if m != nil { - return m.LeftY - } - return 0 -} - -func (m *VirtualLineInfo) GetRightX() int32 { - if m != nil { - return m.RightX - } - return 0 -} - -func (m *VirtualLineInfo) GetRightY() int32 { - if m != nil { - return m.RightY - } - return 0 -} - -type Response struct { - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` - Warning string `protobuf:"bytes,2,opt,name=warning,proto3" json:"warning,omitempty"` - Error string `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Response) Reset() { *m = Response{} } -func (m *Response) String() string { return proto.CompactTextString(m) } -func (*Response) ProtoMessage() {} -func (*Response) Descriptor() ([]byte, []int) { - return fileDescriptor_ffa770372640e731, []int{3} -} - -func (m *Response) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Response.Unmarshal(m, b) -} -func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Response.Marshal(b, m, deterministic) -} -func (m *Response) XXX_Merge(src proto.Message) { - xxx_messageInfo_Response.Merge(m, src) -} -func (m *Response) XXX_Size() int { - return xxx_messageInfo_Response.Size(m) -} -func (m *Response) XXX_DiscardUnknown() { - xxx_messageInfo_Response.DiscardUnknown(m) -} - -var xxx_messageInfo_Response proto.InternalMessageInfo - -func (m *Response) GetMessage() string { - if m != nil { - return m.Message - } - return "" -} - -func (m *Response) GetWarning() string { - if m != nil { - return m.Warning - } - return "" -} - -func (m *Response) GetError() string { - if m != nil { - return m.Error - } - return "" -} - -func init() { - proto.RegisterType((*CamInfo)(nil), "license_plate_recognition.CamInfo") - proto.RegisterType((*Detection)(nil), "license_plate_recognition.Detection") - proto.RegisterType((*VirtualLineInfo)(nil), "license_plate_recognition.VirtualLineInfo") - proto.RegisterType((*Response)(nil), "license_plate_recognition.Response") -} - -func init() { proto.RegisterFile("yolo_grpc.proto", fileDescriptor_ffa770372640e731) } - -var fileDescriptor_ffa770372640e731 = []byte{ - // 401 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x52, 0x4d, 0x8f, 0xd3, 0x30, - 0x10, 0x25, 0xdd, 0x75, 0x4a, 0x66, 0x17, 0x56, 0x32, 0x5f, 0x01, 0x71, 0x88, 0x02, 0x87, 0x88, - 0x43, 0x0f, 0xcb, 0x3f, 0x00, 0x2e, 0x2b, 0x2d, 0x17, 0x6f, 0x85, 0x5a, 0x2e, 0x96, 0x49, 0xa6, - 0xa9, 0xa5, 0xc4, 0x8e, 0x1c, 0xd3, 0x26, 0x47, 0x7e, 0x2d, 0x7f, 0x03, 0xd9, 0x49, 0x1a, 0x09, - 0x69, 0x7b, 0x7c, 0x6f, 0xc6, 0x7e, 0xef, 0xcd, 0x0c, 0xdc, 0xf4, 0xba, 0xd2, 0xbc, 0x34, 0x4d, - 0xbe, 0x6a, 0x8c, 0xb6, 0x9a, 0xbe, 0xad, 0x64, 0x8e, 0xaa, 0x45, 0xde, 0x54, 0xc2, 0x22, 0x37, - 0x98, 0xeb, 0x52, 0x49, 0x2b, 0xb5, 0x4a, 0xff, 0x06, 0xb0, 0xfc, 0x2a, 0xea, 0x3b, 0xb5, 0xd3, - 0xf4, 0x15, 0x84, 0xb9, 0xa8, 0xb9, 0x2c, 0xe2, 0x20, 0x09, 0xb2, 0x88, 0x91, 0x5c, 0xd4, 0x77, - 0x05, 0x7d, 0x0f, 0x91, 0x95, 0x35, 0xb6, 0x56, 0xd4, 0x4d, 0xbc, 0x48, 0x82, 0xec, 0x82, 0xcd, - 0x04, 0x7d, 0x09, 0x44, 0xd6, 0xa2, 0xc4, 0xf8, 0x22, 0x09, 0xb2, 0x6b, 0x36, 0x00, 0xfa, 0x05, - 0xa2, 0x02, 0x2d, 0xe6, 0x4e, 0x23, 0xbe, 0x4c, 0x82, 0xec, 0xea, 0xf6, 0xe3, 0xea, 0x51, 0x17, - 0xab, 0x6f, 0x53, 0x2f, 0x9b, 0x9f, 0xd1, 0xef, 0x70, 0x7d, 0x90, 0xc6, 0xfe, 0x16, 0x15, 0xaf, - 0xa4, 0xc2, 0x98, 0xf8, 0x6f, 0x3e, 0x9d, 0xf9, 0xe6, 0xc7, 0xd0, 0x7e, 0x2f, 0x15, 0xba, 0x40, - 0xec, 0xea, 0x30, 0x13, 0x29, 0x42, 0x74, 0x92, 0x71, 0x51, 0x3b, 0x5e, 0xe1, 0xce, 0xfa, 0xa8, - 0x84, 0x91, 0xee, 0x1e, 0x77, 0x96, 0xbe, 0x00, 0xd2, 0x73, 0xab, 0x87, 0x98, 0x84, 0x5d, 0xf6, - 0x6b, 0xdd, 0xd0, 0xd7, 0x10, 0xee, 0x51, 0x96, 0x7b, 0xeb, 0x23, 0x12, 0x36, 0x22, 0x97, 0xfc, - 0x28, 0x0b, 0xbb, 0xf7, 0xf9, 0x08, 0x1b, 0x40, 0xfa, 0x27, 0x80, 0x9b, 0xff, 0x7c, 0xd0, 0xe7, - 0xb0, 0x18, 0x87, 0x4a, 0xd8, 0x42, 0x16, 0x4e, 0xdd, 0x69, 0xf3, 0x6e, 0xd4, 0x21, 0x0e, 0x6d, - 0x4e, 0x74, 0x3f, 0x0a, 0x79, 0x7a, 0x4b, 0xdf, 0xc0, 0xd2, 0x38, 0x41, 0xde, 0x8d, 0x4a, 0xa1, - 0x87, 0x9b, 0xb9, 0xd0, 0xfb, 0xd9, 0x4c, 0x85, 0x6d, 0xba, 0x86, 0xa7, 0x0c, 0xdb, 0x46, 0xab, - 0x16, 0x69, 0x0c, 0xcb, 0x1a, 0xdb, 0xd6, 0x6d, 0x68, 0xd8, 0xea, 0x04, 0x5d, 0xe5, 0x28, 0x8c, - 0x92, 0xaa, 0xf4, 0x36, 0x22, 0x36, 0x41, 0x97, 0x0c, 0x8d, 0xd1, 0xc6, 0xfb, 0x88, 0xd8, 0x00, - 0x6e, 0x0b, 0x08, 0x1f, 0xd6, 0x5b, 0x5d, 0x69, 0xfa, 0x13, 0x9e, 0x3d, 0xa0, 0x2a, 0xe6, 0x71, - 0xa6, 0x67, 0x96, 0x32, 0x5e, 0xd7, 0xbb, 0x0f, 0x67, 0x7a, 0x26, 0xb7, 0xe9, 0x93, 0x5f, 0xa1, - 0x3f, 0xd9, 0xcf, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x9f, 0xea, 0x20, 0x37, 0xc5, 0x02, 0x00, - 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// STYoloClient is the client API for STYolo service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type STYoloClient interface { - SendDetection(ctx context.Context, in *CamInfo, opts ...grpc.CallOption) (*Response, error) -} - -type sTYoloClient struct { - cc grpc.ClientConnInterface -} - -func NewSTYoloClient(cc grpc.ClientConnInterface) STYoloClient { - return &sTYoloClient{cc} -} - -func (c *sTYoloClient) SendDetection(ctx context.Context, in *CamInfo, opts ...grpc.CallOption) (*Response, error) { - out := new(Response) - err := c.cc.Invoke(ctx, "/license_plate_recognition.STYolo/SendDetection", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// STYoloServer is the server API for STYolo service. -type STYoloServer interface { - SendDetection(context.Context, *CamInfo) (*Response, error) -} - -// UnimplementedSTYoloServer can be embedded to have forward compatible implementations. -type UnimplementedSTYoloServer struct { -} - -func (*UnimplementedSTYoloServer) SendDetection(ctx context.Context, req *CamInfo) (*Response, error) { - return nil, status.Errorf(codes.Unimplemented, "method SendDetection not implemented") -} - -func RegisterSTYoloServer(s *grpc.Server, srv STYoloServer) { - s.RegisterService(&_STYolo_serviceDesc, srv) -} - -func _STYolo_SendDetection_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CamInfo) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(STYoloServer).SendDetection(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/license_plate_recognition.STYolo/SendDetection", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(STYoloServer).SendDetection(ctx, req.(*CamInfo)) - } - return interceptor(ctx, in, info, handler) -} - -var _STYolo_serviceDesc = grpc.ServiceDesc{ - ServiceName: "license_plate_recognition.STYolo", - HandlerType: (*STYoloServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "SendDetection", - Handler: _STYolo_SendDetection_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "yolo_grpc.proto", -} diff --git a/yolo_grpc.proto b/yolo_grpc.proto deleted file mode 100644 index eec4176..0000000 --- a/yolo_grpc.proto +++ /dev/null @@ -1,37 +0,0 @@ -syntax = "proto3"; -package license_plate_recognition; - -message CamInfo{ - string cam_id = 1; - int64 timestamp = 2; - bytes image = 3;// bytes of full image in PNG - format - Detection detection = 4; - VirtualLineInfo virtual_line = 5; -} - -message Detection{ - int32 x_left = 1; - int32 y_top = 2; - int32 height = 3; - int32 width = 4; -} - -message VirtualLineInfo{ - int32 id = 1; - int32 left_x = 2; - int32 left_y = 3; - int32 right_x = 4; - int32 right_y = 5; -} - -message Response { - string message = 1; - string warning = 2; - string error = 3; -} - -// STYolo - service for second and third yolo stages -// in car number search cascade -service STYolo{ - rpc SendDetection(CamInfo) returns (Response){}; -} \ No newline at end of file