我在新版本中使用 grpc </ code>作为 IPC </ code> 我正在构建的软件,但是遇到了这个问题:Go中的grpc客户端植入是同步还是异步?

在Internet上冲浪我发现C ++既有实现,又在Go中缺少有关此功能的文档 (除了GitHub上的一个问题。)
由于这个原因,我开始检查客户端代码,发现客户端请求是由 invoke </ code>函数发出的(此处代码),并且似乎正在同步运行。


的:</ p>

ClientA * grpc.Client
ClientB * grpc.Client
//其他 stuff
client:= createNewClient()//此函数返回一个* grpc客户
foo:= Foo {client}
bar:= Bar {client}
</ code> </ pre>

我应该为 Foo </ code>和 Bar </ code>结构的每个函数创建一个新客户端,以执行调用而不是线程阻塞。 这是正确的吗? </ p>
</ div>



I'm using grpc as IPC in a new software that I'm building but I came across this question: the grpc Client implantation in Go is synchronous or asynchronous?
Surfing on internet I discover that the C++ has both implementation but in Go there is lack of documentation about this feature (apart an issue on GitHub).
For this reason I start inspecting the Client code and I found that the client request is made by the invoke function (here the code) and seems that is running synchronously. For this reason I'm supposing that instead of using a global client and then pass to the struct that use the grpc functions I should create a client for each request to prevent a synchronous behaviour.
e.g. Instead of:

type Foo struct {
    ClientA *grpc.Client
type Bar struct {
    ClientB *grpc.Client
//Other stuff
client := createNewClient() //This function return a *grpc client 
foo := Foo{client}
bar := Bar{client}

I should create a new client for each function of Foo and Bar struct for executing calls not thread blocking. Is it correct?

dongzhuo2010 什么是grpc.Client?我在API中看不到类似内容吗?您是指ClientConn吗?如果是这样,我不明白为什么您只能在单独的goroutine中调用grpc调用。您有什么具体限制吗?
3 年多之前 回复
doq8211 我不必担心会打开成千上万的新灌浆(go例程堆栈非常轻,大约2kb),但更多的是每个客户端产生的成本。无论如何,我都会实现,至少我会在grpc存储库上发出拉取请求
3 年多之前 回复
doukao2180 Go确实没有线程,您可以轻松地一次打开数千个goroutine,go的整个调度模型使异步编程的概念变得多余。因此,不必担心,并且无法打开尽可能多的线程。服务器可能已经针对每个连接执行了该操作。
3 年多之前 回复
Csdn user default icon

<div class="post-text" itemprop="text"> <p>I am building an application which can have multiple gRPC servers and definitely will have multiple gRPC clients, I wanted to know, how to identify on server side that this is the client I am talking to and only send data to that client. I am using bidirectional streaming RPC and right now the data gets broadcasted to every client and I don't want that. What functions in go gRPC make it possible or how can I implement it?</p> </div>


<div class="post-text" itemprop="text"> <p>I would like to know, how flow control works in a client-streaming gRPC service in Go. </p> <p>Specifically, I am interested in knowing when will a call to <code>stream.SendMsg()</code> function in the client-side block? According to the <a href="" rel="nofollow noreferrer">documentation</a> :</p> <blockquote> <p>SendMsg() blocks until : </p> <ul> <li>There is sufficient flow control to schedule m with the transport, or ...</li> </ul> </blockquote> <p>So what is the specification for the flow control mechanism of the stream? For example, if the server-side code responsible for reading the messages from the stream, isn't reading the messages fast enough, at what point will calls to SendMsg() block? </p> <p>Is there some kind of backpressure mechanism implemented for the server to tell the client that it is not ready to receive more data? In the meantime, where are all the messages that have been successfully sent before the backpressure signal, queued?</p> </div>


<div class="post-text" itemprop="text"> <p>Could someone please help me understand the usage of the channel in the client side of gRPC code here (for bidirectional streaming RPC): <a href="" rel="nofollow noreferrer"></a></p> <p>This is the code:</p> <pre><code>stream, err := client.RouteChat(context.Background()) waitc := make(chan struct{}) go func() { for { in, err := stream.Recv() if err == io.EOF { // read done. close(waitc) return } if err != nil { log.Fatalf("Failed to receive a note : %v", err) } log.Printf("Got message %s at point(%d, %d)", in.Message, in.Location.Latitude, in.Location.Longitude) } }() for _, note := range notes { if err := stream.Send(note); err != nil { log.Fatalf("Failed to send a note: %v", err) } } stream.CloseSend() &lt;-waitc </code></pre> <p>Thanks!</p> </div>


<div class="post-text" itemprop="text"> <p>Official gRPC documentation for client streaming states that: </p> <blockquote> <p>The server sends back a single response, typically but not necessarily after it has received all the client’s requests...</p> </blockquote> <p>What I'm trying to do is to catch server response in the middle of the stream to stop sending more data.</p> <p>In Go I can spin up a new goroutine listening for the message from the server using <a href="" rel="nofollow noreferrer">RecvMsg</a>, but I can't find a way to do the same in C++. It looks like <a href="" rel="nofollow noreferrer">ClientWriter</a> doesn't offer this kind of functionality.</p> <p>One solution would be to have a bidirectional stream but was wondering if there is any other way to achieve this in C++.</p> </div>

使用golang gRPC客户端拨打多个IP地址

<div class="post-text" itemprop="text"> <p>I have grpc server <code></code> and <code></code>, I want to connect them use <code>grpc.Dial</code> with ip list, not server discover, How can I do?</p> <pre><code>conn, err = grpc.Dial(",", grpc.WithInsecure()) </code></pre> <p>with error</p> <pre><code>rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = \"transport: Error while dialing dial tcp: too many colons in address, </code></pre> </div>


<div class="post-text" itemprop="text"> <p>I have a <strong>gRPC</strong> client and a server, when I run them they seem to be running fine, but when I try to dial a server with a client I get an error:</p> <pre><code>"Error": { "code": 14, "message": "all SubConns are in TransientFailure" }, </code></pre> <p>No idea what is it. I tried to find a solution with google, no success there.</p> <p>Any ideas? Here is my server code:</p> <pre><code>lis, err := net.Listen("tcp", fmt.Sprintf("%s:%d", cfg.Host, cfg.Port)) if err != nil { logger.Critical(ctx, "failed to listen: %v", err) } else { logger.Info(ctx, "[userserver] running at %s:%d", cfg.Host, cfg.Port) } grpcServer := grpc.NewServer() userServer := userserver.New() pb.RegisterDomainServer(grpcServer, userServer) rpcErr := grpcServer.Serve(lis) if rpcErr != nil { logger.Critical(ctx, "failed to serve: %v", rpcErr) } </code></pre> <p>btw the server here shows log:</p> <blockquote> <p>2018/02/08 07:03:37.603287 INFO: [userserver] running at localhost:3001</p> </blockquote> <p>and client:</p> <pre><code>conn, err := grpc.Dial(c.serverAddr, grpc.WithInsecure()) if err != nil { return err } defer conn.Close() client := pb.NewDomainClient(conn) _, err = client.Dispatch(ctx, &amp;pb.Command{ Name: command, Payload: payload, }) </code></pre> <p>and this is port buff</p> <pre><code>service Domain { rpc Dispatch(Command) returns (Response); } message Command { string name = 1; bytes payload = 2; } message Response {} </code></pre> </div>

如何在Golang gRPC中获取客户端IP地址和用户代理?

<div class="post-text" itemprop="text"> <p>我设置了一系列GRPC请求和响应,它们都可以正常工作,但是当我试图获取调用我的GRPCAPI的客户端IP地址和用户代理时,我陷入了困境。</p> <p>我阅读了GRPC文档和其他来源,但没有找到多少有价值的信息。他们中很少有人在Golang中谈论GRPC。</p> <p>在设置GRPCAPI时,是否应该设置一个键值来将IP地址存储在上下文中?</p> </div>


<div class="post-text" itemprop="text"> <p>I use docker-compose or kubernetes to deploy my gRPC servers, and want to get the server IP address in the go client. Does the gRPC library provides the get server-side IP method?</p> <p>BTW, the scenario here is that i want to log the server ip to check whether nginx, envoy and other L7 load balancers make correct routing decisions.</p> </div>


<div class="post-text" itemprop="text"> <p>I am building a client/server system in go, using gRPC and protobuf (and with a gRPC gateway to REST).</p> <p>I use <a href="" rel="nofollow noreferrer">metadata</a> in the context on the server side to carry authentication data from the client, and that works perfectly well.</p> <p>Now, I'd like the server to set some metadata keys/values so that the client can get them, alongside with the response. How can I do that? Using <a href="" rel="nofollow noreferrer">SetHeader</a> and <a href="" rel="nofollow noreferrer">SendHeader</a>? Ideally, I'd like every single response from the server to integrate that metadata (can be seen as some kind of <a href="" rel="nofollow noreferrer">UnaryInterceptor</a>, but on the response rather than the request?)</p> <p>Here is the code for the <a href="" rel="nofollow noreferrer">server</a> and for the <a href="" rel="nofollow noreferrer">client</a>.</p> </div>

C ++ GRPC客户端和golang服务器之间的连接错误

<div class="post-text" itemprop="text"> <p>I'm trying to write a GRPC server that talks to both a C++ and golang client. Since this is all internal to our system, there will be a self-signed certificate that signs the server certificate, and the server will sign the client certificates.</p> <p>I'm able to connect to the server from the golang client. However, the C++ client doesn't connect, and I see a bunch of errors from the ssl layer. What am I doing incorrectly in my configuration of the C++ grpc client?</p> <p>(My certificates all use a 2048bit RSA key for now)</p> <p>Here are the client codes that I thought were equivalent (error handling elided):</p> <p><strong>Golang:</strong></p> <pre class="lang-golang prettyprint-override"><code>import ( "crypto/tls" "io/ioutil" "" "" ) func getConnection(hostPort string) (*grpc.ClientConn, error) { var config tls.Config cert, _ := tls.LoadX509KeyPair("client.crt", "client.key") config.Certificates = append(config.Certificates, cert) b, _ := ioutil.ReadFile("root.crt") config.RootCAs.AppendCertsFromPEM(b) options := grpc.WithTransportCredentials(credentials.NewTLS(config)) return grpc.Dial(hostPort, options) } </code></pre> <p><strong>C++:</strong></p> <pre class="lang-cpp prettyprint-override"><code>#include &lt;fstream&gt; #include &lt;string&gt; #include &lt;grpc++/grpc++.h&gt; std::shared_ptr&lt;grpc::Channel&gt; get_connection(const std::string&amp; host_port) { auto contents = [](const std::string&amp; filename) -&gt; std::string { std::ifstream fh(filename); std::stringstream buffer; buffer &lt;&lt; fh.rdbuf(); fh.close(); return buffer.str(); }; auto ssl_options = grpc::SslCredentialsOptions(); ssl_options.pem_cert_chain = contents("client.crt"); ssl_options.pem_private_key = contents("client.key"); ssl_options.pem_root_certs = contents("root.crt"); auto creds = grpc::SslCredentials(ssl_options); auto channel = grpc::CreateChannel(hostport, creds); } </code></pre> <p>My error messages:</p> <p><strong>C++ Client error messages</strong></p> <pre><code>D0322 14:42:12.882767371 11701 env_linux.c:77] Warning: insecure environment read function 'getenv' used getting job record E0322 14:42:12.930157873 11701 ssl_transport_security.c:945] Handshake failed with fatal error SSL_ERROR_SSL: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed. E0322 14:42:12.930231627 11701 handshake.c:128] Security handshake failed: {"created":"@1490218932.930210185","description":"Handshake failed","file":"src/core/lib/security/transport/handshake.c","file_line":264,"tsi_code":10,"tsi_error":"TSI_PROTOCOL_FAILURE"} E0322 14:42:12.964082644 11701 ssl_transport_security.c:945] Handshake failed with fatal error SSL_ERROR_SSL: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed. E0322 14:42:12.964134746 11701 handshake.c:128] Security handshake failed: {"created":"@1490218932.964114213","description":"Handshake failed","file":"src/core/lib/security/transport/handshake.c","file_line":264,"tsi_code":10,"tsi_error":"TSI_PROTOCOL_FAILURE"} std::string JobServerClient::getJobRecord(const string&amp;) const: GRPC connection error 14 [] </code></pre> <p><strong>Golang Client error messages</strong></p> <pre><code>2017/03/22 17:42:12 grpc: Server.Serve failed to create ServerTransport: connection error: desc = "transport: EOF" 2017/03/22 17:42:12 grpc: Server.Serve failed to create ServerTransport: connection error: desc = "transport: EOF" </code></pre> <p>What additional debugging can I do to determine where the C++ client is going awry?</p> </div>

docker swarm中的golang gRPC更新映像每次必须重新连接客户端

<div class="post-text" itemprop="text"> <p>I have a docker swarm on three nodes plus an external mysql service (outside of the swarm). I am programming micro-services with an API Gateway in golang and gRPC. I have two problems. </p> <p>The first problem is when I push an update a service with <code>docker swarm update --image ... myservice</code> I get the error on my API Gateway from each micro-service <code>transport is closing</code> for three requests to the gateway. (I am assuming each task needs to reconnect on each service?) How can I fix this? Each service has <code>update-delay</code> set to <code>30s</code> and <code>update-parallelism</code> set to <code>1</code>. Shouldn't the api gateway stay connected to each service if there are rolling updates? </p> <p>The second problem is after an idol time (not sure how long) I am getting the same issue from above that the services are closing and I have to do three requests to the api gateway for it to work. Any help appreciated. I am running Ubuntu 16.04 with Docker version 17.12.0-ce, build c97c6d6 and am building go version go1.9.4 darwin/amd64</p> <p>A service example:</p> <pre><code> // listen on address lis, err := net.Listen(network, address) if err != nil { log.Fatalf("failed to listen: %v", err) } defer lis.Close() // create users server s := grpc.NewServer() pb.RegisterUsersServer(s, &amp;server{}) // register reflection service on gRPC server. reflection.Register(s) // message will run after serve if err == nil go func() { time.Sleep(time.Second) log.Printf("started users service on %s", address) }() if err := s.Serve(lis); err != nil { log.Fatalf("failed to serve: %v", err) } </code></pre> <p>My api gateway connection</p> <pre><code>// connect to users usersConnection, err := grpc.Dial(usersAddress, grpc.WithInsecure()) if err != nil { log.Fatalf("did not connect: %v", err) } users = userspb.NewUsersClient(usersConnection) log.Println("connected to users") </code></pre> </div>

如何为安全的go grpc服务创建不安全的Java grpc客户端

<div class="post-text" itemprop="text"> <p>I am trying to create grpc service client in Java where server is in goLang and deployed with the https . where I am trying to achieve a non-secured connection [I don't want to pass the certificate ]</p> <pre><code>public class testgrpc { ManagedChannel channel ; ServiceGrpc.ServiceBlockingStub blockingStub; String host = "remotesecuredhost"; int port ="XXX"; @Test public void testgrpc() { channel = ManagedChannelBuilder.forAddress(host,port).build(); blockingStub = ServiceGrpc.newBlockingStub(channel); response =; } } </code></pre> <p>the above code gives following exception </p> <pre><code>io.grpc.StatusRuntimeException: UNAVAILABLE: io exception at io.grpc.stub.ClientCalls.toStatusRuntimeException( at io.grpc.stub.ClientCalls.getUnchecked( at io.grpc.stub.ClientCalls.blockingUnaryCall( </code></pre> <p>can someone help with Client code </p> </div>

grpc go:当客户端关闭连接时,如何在服务器端知道

<div class="post-text" itemprop="text"> <p>I am using grpc go</p> <p>i have an rpc which looks roughly like this</p> <pre><code>196 service MyService { 197 // Operation 1 198 rpc Operation1(OperationRequest) returns (OperationResponse) { 199 option (google.api.http) = { 200 post: "/apiver/myser/oper1" 201 body: "*" 202 }; 203 } </code></pre> <p>Client connects by using grpc.Dial() method</p> <p>When a client connects, the server does some book keeping. when the client disconnects, the bookkeeping needs to be removed.</p> <p>is there any callback that can be registered which can be used to know that client has closed the session.</p> </div>


<div class="post-text" itemprop="text"> <p>I am building an API using gRPC and in server side, I want to receive a notification when a client disconnects, identify it and perform some tasks based on that.</p> <p>So far, I was able to detect client disconnection using <code>grpc.StatsHandler</code> method <code>HandleConn</code>. I tried passing values using context, but they can't be accessed from server side.</p> <p>Client side:</p> <pre class="lang-golang prettyprint-override"><code>conn, err := grpc.DialContext( context.WithValue(context.Background(), "user_id", 1234), address, grpc.WithInsecure(), ) </code></pre> <p>Server side:</p> <pre class="lang-golang prettyprint-override"><code>// Build stats handler type serverStats struct {} func (h *serverStats) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context { return ctx } func (h *serverStats) HandleRPC(ctx context.Context, s stats.RPCStats) {} func (h *serverStats) TagConn(ctx context.Context, info *stats.ConnTagInfo) context.Context { return context.TODO() } func (h *serverStats) HandleConn(ctx context.Context, s stats.ConnStats) { fmt.Println(ctx.Value("user_id")) // Returns nil, can't access the value switch s.(type) { case *stats.ConnEnd: fmt.Println("client disconnected") break } } // Build server s := grpc.NewServer(grpc.StatsHandler(&amp;serverStats{})) </code></pre> <p>I want to access the value passed from client side in server side. What is the right way to do it, or is there any other way to identify the client that has disconnected?</p> </div>


<div class="post-text" itemprop="text"> <p>Considering the example from the Go gRPC code base:</p> <pre><code>func main() { // Set up a connection to the server. conn, err := grpc.Dial(address, grpc.WithInsecure()) if err != nil { log.Fatalf("did not connect: %v", err) } defer conn.Close() c := pb.NewGreeterClient(conn) // Contact the server and print out its response. name := defaultName if len(os.Args) &gt; 1 { name = os.Args[1] } r, err := c.SayHello(context.Background(), &amp;pb.HelloRequest{Name: name}) if err != nil { log.Fatalf("could not greet: %v", err) } log.Printf("Greeting: %s", r.Message) } </code></pre> <p>When consuming a gRPC service from another service what should the scope of the connection (<code>conn</code>) be? I assume it should have affinity with the scope of the request being handled be the consumer service, but I have yet to find any documentation around this. Should I be using a connection pool here?</p> <p>E.G.</p> <ol> <li>gRPC consumer service receives request</li> <li>establish connection to gRPC service (either directly or via pool)</li> <li>make <em>n</em> requests to gRPC service</li> <li>close gRPC connection (or release back to the pool) </li> </ol> </div>


<div class="post-text" itemprop="text"> <p>I have defined an endpoint in the grpc service. Now when the client calls the endpoint with some context how am I supposed to handle that context, its expiry/deadline etc?</p> <p>I mean in the service side, I have a series of steps to be performed to complete the request. It includes some processing, writing to data store etc. Now how am I supposed to honor the context. Is it that after every step in the process, I am required to check if the context is done?. If it is done, I will just return instead of proceeding to the next step? This doesn't feel right though.</p> <p>What is the right way to do it in GRPC/Go?</p> </div>

使用自签名客户端证书进行grpc tls相互身份验证不良证书

<div class="post-text" itemprop="text"> <p>Does Go gRPC support mutual TLS using self-signed client certs? I'm trying to get mutual TLS working on Go gRPC, and I generated self-signed certs for the server and client using <code>src/crypto/tls/generate_cert.go</code>, and the client is failing to connect with the server stating it's a bad cert.</p> <p>Here's the relevant server code:</p> <pre><code>// load server cert/key, cacert srvcert, err := tls.LoadX509KeyPair("server.pem", "key.pem") if err != nil { log.Fatalf("SERVER: unable to read server key pair: %v", err) } pem, err := ioutil.ReadFile("../client/client.pem") if err != nil { log.Fatalf("SERVER: unable to read client pem: %v", err) } certPool := x509.NewCertPool() if ok := certPool.AppendCertsFromPEM(pem); !ok { log.Fatalf("SERVER: unable to add client cert to pool: %v", err) } ta := credentials.NewTLS(&amp;tls.Config{ Certificates: []tls.Certificate{srvcert}, ClientCAs: certPool, ClientAuth: tls.RequireAndVerifyClientCert, }) lis, err := net.Listen("tcp", ":51150") if err != nil { log.Fatalf("SERVER: unable to listen: %v", err) } s := grpc.NewServer(grpc.Creds(ta)) pb.RegisterExpoServer(s, &amp;server{}) if err := s.Serve(lis); err != nil { log.Fatalf("SERVER: failed to serve: %v", err) } </code></pre> <p>And the relevant client code:</p> <pre><code>// load client cert/key, cacert clcert, err := tls.LoadX509KeyPair("client.pem", "key.pem") if err != nil { log.Fatalf("CLIENT: unable to load client pem: %v", err) } srvcert, err := ioutil.ReadFile("../server/server.pem") if err != nil { log.Fatalf("CLIENT: unable to load server cert: %v", err) } caCertPool := x509.NewCertPool() if ok := caCertPool.AppendCertsFromPEM(srvcert); !ok { log.Fatalf("CLIENT: unable to load server cert pool: %v", err) } ta := credentials.NewTLS(&amp;tls.Config{ Certificates: []tls.Certificate{clcert}, RootCAs: caCertPool, }) conn, err := grpc.Dial("localhost:51150", grpc.WithTransportCredentials(ta)) if err != nil { log.Fatalf("CLIENT: unable to dial: %v", err) } c := pb.NewExpoClient(conn) </code></pre> <p>The client is able to dial okay, but the error comes when trying to call an RPC on the client:</p> <pre><code>2018/07/28 19:32:18 CLIENT: unable to checkin: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: authentication handshake failed: remote error: tls: bad certificate" </code></pre> </div>


<div class="post-text" itemprop="text"> <p>I am using go-grpc to create a bidirectional stream. When I unplug the cable, the server doesn't known client is dead for a very very long time. How can I detect client is gone in this case ???</p> </div>


<div class="post-text" itemprop="text"> <p>我现在正在 gRPC 中创建一个小型聊天应用程序,我遇到了一个问题,如果一个用户希望作为客户端连接到 gRPC 服务器,我希望广播该事件已发生到所有其他已连接的客户端。</p> <p>我正在考虑使用某种观察者,但是我不知道服务器如何知道谁被连接、以及我如何向所有客户机而不是仅仅一两个客户机广播事件。</p> <p>我知道使用流是一种方法,但是因为每个客户机都在服务器上创建自己的流,所以我不确定它如何能够订阅其他服务器-客户机流。</p> </div>


获取讲师答疑方式: 在付费视频第一节(触摸命令_ALL)片头有二维码及加群流程介绍 限时福利 原价99元,今日仅需39元!购课添加小助手(微信号:csdn590)按提示还可领取价值800元的编程大礼包! 讲师介绍: 苏奕嘉&nbsp;前阿里UC项目工程师 脚本开发平台官方认证满级(六级)开发者。 我将如何教会你通过【定制脚本】赚到你人生的第一桶金? 零基础程序定制脚本开发课程,是完全针对零脚本开发经验的小白而设计,课程内容共分为3大阶段: ①前期将带你掌握Q开发语言和界面交互开发能力; ②中期通过实战来制作有具体需求的定制脚本; ③后期将解锁脚本的更高阶玩法,打通任督二脉; ④应用定制脚本合法赚取额外收入的完整经验分享,带你通过程序定制脚本开发这项副业,赚取到你的第一桶金!


课程演示环境:Windows10; cuda 10.2; cudnn7.6.5; Python3.7; VisualStudio2019; OpenCV3.4 需要学习ubuntu系统上YOLOv4的同学请前往:《YOLOv4目标检测实战:训练自己的数据集》 课程链接: YOLOv4来了!速度和精度双提升! 与 YOLOv3 相比,新版本的 AP (精度)和 FPS (每秒帧率)分别提高了 10% 和 12%。 YOLO系列是基于深度学习的端到端实时目标检测方法。本课程将手把手地教大家使用labelImg标注和使用YOLOv4训练自己的数据集。课程实战分为两个项目:单目标检测(足球目标检测)和多目标检测(足球和梅西同时检测)。 本课程的YOLOv4使用AlexyAB/darknet,在Windows系统上做项目演示。包括:安装软件环境、安装YOLOv4、标注自己的数据集、整理自己的数据集、修改配置文件、训练自己的数据集、测试训练出的网络模型、性能统计(mAP计算)和先验框聚类分析。还将介绍改善YOLOv4目标检测性能的技巧。 除本课程《Windows版YOLOv4目标检测实战:训练自己的数据集》外,本人将推出有关YOLOv4目标检测的系列课程。请持续关注该系列的其它视频课程,包括: 《Windows版YOLOv4目标检测实战:人脸口罩佩戴检测》 《Windows版YOLOv4目标检测实战:中国交通标志识别》 《Windows版YOLOv4目标检测:原理与源码解析》


lena全身原图(非256*256版本,而是全身原图) lena原图很有意思,我们通常所用的256*256图片是在lena原图上截取了头部部分的256*256正方形得到的. 原图是花花公子杂志上的一个

快速入门Android开发 视频 教程 android studio

这是一门快速入门Android开发课程,顾名思义是让大家能快速入门Android开发。 学完能让你学会如下知识点: Android的发展历程 搭建Java开发环境 搭建Android开发环境 Android Studio基础使用方法 Android Studio创建项目 项目运行到模拟器 项目运行到真实手机 Android中常用控件 排查开发中的错误 Android中请求网络 常用Android开发命令 快速入门Gradle构建系统 项目实战:看美图 常用Android Studio使用技巧 项目签名打包 如何上架市场


Java 使用微信支付 一. 准备工作 1.




一 专题从基础的C语言核心到c++ 和stl完成基础强化; 二 再到数据结构,设计模式完成专业计算机技能强化; 三 通过跨平台网络编程,linux编程,qt界面编程,mfc编程,windows编程,c++与lua联合编程来完成应用强化 四 最后通过基于ffmpeg的音视频播放器,直播推流,屏幕录像,


【超实用课程内容】 程序员对于算法一直又爱又恨!特别是在求职面试时,算法类问题绝对是不可逃避的提问点!本门课程作为算法面试系列的第一季,会从“知己知彼”的角度,聊聊关于算法面试的那些事~ 【哪些人适合学习这门课程?】 求职中的开发者,对于面试算法阶段缺少经验 想了解实际工作中算法相关知识 在职程序员,算法基础薄弱,急需充电 【超人气讲师】 孙秀洋&nbsp;| 服务器端工程师 硕士毕业于哈工大计算机科学与技术专业,ACM亚洲区赛铜奖获得者,先后在腾讯和百度从事一线技术研发,对算法和后端技术有深刻见解。 【课程如何观看?】 PC端: 移动端:CSDN 学院APP(注意不是CSDN APP哦) 本课程为录播课,课程无限观看时长,但是大家可以抓紧时间学习后一起讨论哦~




Python入门视频培训课程以通俗易懂的方式讲解Python核心技术,Python基础,Python入门。适合初学者的教程,让你少走弯路! 课程内容包括:1.Python简介和安装 、2.第一个Python程序、PyCharm的使用 、3.Python基础、4.函数、5.高级特性、6.面向对象、7.模块、8.异常处理和IO操作、9.访问数据库MySQL。教学全程采用笔记+代码案例的形式讲解,通俗易懂!!!




深度学习系列课程从深度学习基础知识点开始讲解一步步进入神经网络的世界再到卷积和递归神经网络,详解各大经典网络架构。实战部分选择当下最火爆深度学习框架PyTorch与Tensorflow/Keras,全程实战演示框架核心使用与建模方法。项目实战部分选择计算机视觉与自然语言处理领域经典项目,从零开始详解算法原理,debug模式逐行代码解读。适合准备就业和转行的同学们加入学习! 建议按照下列课程顺序来进行学习 (1)掌握深度学习必备经典网络架构 (2)深度框架实战方法 (3)计算机视觉与自然语言处理项目实战。(按照课程排列顺序即可)




文章目录经典飞机大战一.游戏设定二.我方飞机三.敌方飞机四.发射子弹五.发放补给包六.主模块 经典飞机大战 源代码以及素材资料(图片,音频)可从下面的github中下载: 飞机大战源代码以及素材资料github项目地址链接 ————————————————————————————————————————————————————————— 不知道大家有没有打过飞机,喜不喜欢打飞机。当我第一次接触这个东西的时候,我的内心是被震撼到的。第一次接触打飞机的时候作者本人是身心愉悦的,因为周边的朋友都在打飞机, 每

2018年全国大学生计算机技能应用大赛决赛 大题







使用 verilog 实现地铁售票






【为什么学爬虫?】 &nbsp; &nbsp; &nbsp; &nbsp;1、爬虫入手容易,但是深入较难,如何写出高效率的爬虫,如何写出灵活性高可扩展的爬虫都是一项技术活。另外在爬虫过程中,经常容易遇到被反爬虫,比如字体反爬、IP识别、验证码等,如何层层攻克难点拿到想要的数据,这门课程,你都能学到! &nbsp; &nbsp; &nbsp; &nbsp;2、如果是作为一个其他行业的开发者,比如app开发,web开发,学习爬虫能让你加强对技术的认知,能够开发出更加安全的软件和网站 【课程设计】 一个完整的爬虫程序,无论大小,总体来说可以分成三个步骤,分别是: 网络请求:模拟浏览器的行为从网上抓取数据。 数据解析:将请求下来的数据进行过滤,提取我们想要的数据。 数据存储:将提取到的数据存储到硬盘或者内存中。比如用mysql数据库或者redis等。 那么本课程也是按照这几个步骤循序渐进的进行讲解,带领学生完整的掌握每个步骤的技术。另外,因为爬虫的多样性,在爬取的过程中可能会发生被反爬、效率低下等。因此我们又增加了两个章节用来提高爬虫程序的灵活性,分别是: 爬虫进阶:包括IP代理,多线程爬虫,图形验证码识别、JS加密解密、动态网页爬虫、字体反爬识别等。 Scrapy和分布式爬虫:Scrapy框架、Scrapy-redis组件、分布式爬虫等。 通过爬虫进阶的知识点我们能应付大量的反爬网站,而Scrapy框架作为一个专业的爬虫框架,使用他可以快速提高我们编写爬虫程序的效率和速度。另外如果一台机器不能满足你的需求,我们可以用分布式爬虫让多台机器帮助你快速爬取数据。 &nbsp; 从基础爬虫到商业化应用爬虫,本套课程满足您的所有需求! 【课程服务】 专属付费社群+每周三讨论会+1v1答疑




《YOLOv3目标检测实战系列课程》旨在帮助大家掌握YOLOv3目标检测的训练、原理、源码与网络模型改进方法。 本课程的YOLOv3使用原作darknet(c语言编写),在Ubuntu系统上做项目演示。 本系列课程包括三门课: (1)《YOLOv3目标检测实战:训练自己的数据集》 包括:安装darknet、给自己的数据集打标签、整理自己的数据集、修改配置文件、训练自己的数据集、测试训练出的网络模型、性能统计(mAP计算和画出PR曲线)和先验框聚类。 (2)《YOLOv3目标检测:原理与源码解析》讲解YOLOv1、YOLOv2、YOLOv3的原理、程序流程并解析各层的源码。 (3)《YOLOv3目标检测:网络模型改进方法》讲解YOLOv3的改进方法,包括改进1:不显示指定类别目标的方法 (增加功能) ;改进2:合并BN层到卷积层 (加快推理速度) ; 改进3:使用GIoU指标和损失函数 (提高检测精度) ;改进4:tiny YOLOv3 (简化网络模型)并介绍 AlexeyAB/darknet项目。


【超实用课程内容】 本课程演示的是一套基于Java的SSM框架实现的图书管理系统,主要针对计算机相关专业的正在做毕设的学生与需要项目实战练习的java人群。详细介绍了图书管理系统的实现,包括:环境搭建、系统业务、技术实现、项目运行、功能演示、系统扩展等,以通俗易懂的方式,手把手的带你从零开始运行本套图书管理系统,该项目附带全部源码可作为毕设使用。 【课程如何观看?】 PC端: 移动端:CSDN 学院APP(注意不是CSDN APP哦) 本课程为录播课,课程2年有效观看时长,大家可以抓紧时间学习后一起讨论哦~ 【学员专享增值服务】 源码开放 课件、课程案例代码完全开放给你,你可以根据所学知识,自行修改、优化


微信小程序番茄时钟视频教程,本课程将带着各位学员开发一个小程序初级实战类项目,针对只看过官方文档而又无从下手的开发者来说,可以作为一个较好的练手项目,对于有小程序开发经验的开发者而言,可以更好加深对小程序各类组件和API 的理解,为更深层次高难度的项目做铺垫。

Java 最常见的 200+ 面试题:面试必备

这份面试清单是从我 2015 年做了 TeamLeader 之后开始收集的,一方面是给公司招聘用,另一方面是想用它来挖掘在 Java 技术栈中,还有那些知识点是我不知道的,我想找到这些技术盲点,然后修复它,以此来提高自己的技术水平。虽然我是从 2009 年就开始参加编程工作了,但我依旧觉得自己现在要学的东西很多,并且学习这些知识,让我很有成就感和满足感,那所以何乐而不为呢? 说回面试的事,这份面试...


文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...



微信小程序 实例汇总 完整项目源代码

微信小程序 实例汇总 完整项目源代码


基于西门子S7—1200的单部六层电梯设计程序,1部6层电梯。 本系统控制六层电梯, 采用集选控制方式。 为了完成设定的控制任务, 主要根据电梯输入/输出点数确定PLC 的机型。 根据电梯控制的要求,

相关热词 c#分级显示数据 c# 不区分大小写替换 c#中调用就java c#正则表达式 验证小数 c# vscode 配置 c#三维数组能存多少数据 c# 新建excel c#多个文本框 c#怎么创建tcp通讯 c# mvc 电子病例