20 lines
501 B
Python
20 lines
501 B
Python
from concurrent import futures
|
|
import grpc
|
|
import msw_pb2 as msw_pb2
|
|
import msw_pb2_grpc as msw_pb2_grpc
|
|
|
|
channel = grpc.insecure_channel("127.0.0.1:8888")
|
|
stub = msw_pb2_grpc.MSWStub(channel)
|
|
|
|
testImageFile = "/home/hmsy/Pictures/Screenshots/Screenshot_20240515_103419.jpeg"
|
|
with open(testImageFile, "rb") as f:
|
|
imageData = f.read()
|
|
|
|
count = 0
|
|
while 1:
|
|
response = stub.ClipEmbeddingForImage(
|
|
msw_pb2.ClipEmbeddingForImageRequest(Image=imageData)
|
|
)
|
|
count += 1
|
|
print(count)
|