in Education by
I am new to python and cloud vision.I need to label ~20k images.My code although does the work, needs lots of time to process.Is there a way I can be more efficient?Any help will be really appreciated filename=[] description=[] score=[] for root, dirs, filenames in os.walk(indir): for f in filenames: if f.endswith('.jpg'): file_name=indir+'/'+f with io.open(file_name, 'rb') as image_file: content = image_file.read() image = types.Image(content=content) response = client.label_detection(image=image) labels = response.label_annotations for label in labels: filename.append(f) description.append(label.description) score.append(label.score) import pandas as pd vision_op = pd.DataFrame( {'filename': filename, 'description': description, 'score': score }) JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
You could send the requests from multiple threads to speed it up. You can also send multiple images in a single API call since annotate accepts multiple AnnotateImageRequests.

Related questions

0 votes
    I tried to find out how to use firestore local emulator for python and for testing purpose. But I ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    This feels like a noobish question to which I should be able to find the answer on the web, but ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    Executive su Which part of the 5 step Strategic Design process keeps the User at the Center Future ... Disruptive Insights Submit Select the correct answer from above options...
asked Dec 6, 2021 in Education by JackTerrance
0 votes
    Executive su Which part of the 5 step Strategic Design process keeps the User at the Center Future ... Disruptive Insights Submit Select the correct answer from above options...
asked Dec 5, 2021 in Education by JackTerrance
0 votes
    Executive su Which part of the 5 step Strategic Design process keeps the User at the Center Future ... Disruptive Insights Submit Select the correct answer from above options...
asked Nov 26, 2021 in Education by JackTerrance
0 votes
    What are some large cloud providers and databases?...
asked Dec 16, 2020 in Technology by JackTerrance
0 votes
    Give some example of large cloud provider and databases?...
asked Dec 16, 2020 in Technology by JackTerrance
0 votes
    What are the platforms used for large scale cloud computing?...
asked Dec 15, 2020 in Technology by JackTerrance
0 votes
    Which platforms are used for large scale cloud computing?...
asked Dec 15, 2020 in Technology by JackTerrance
0 votes
    I have huge JSON files in a folder approx 200 each of 300 mbs approx. I need to write Spring ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    Which of the following is method of JDBC batch process? (a) setBatch() (b) deleteBatch() (c) removeBatch() (d ... Beans & JDBC of Java Select the correct answer from above options...
asked Feb 22, 2022 in Education by JackTerrance
0 votes
    Which of the following is method of JDBC batch process? (a) setBatch() (b) deleteBatch() (c) ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    Ants locate sucrose by (a) using a strong sense of smell (b) using a keen sense of vision (c) ... emitted/reflected by sucrose Select the correct answer from above options...
asked Nov 9, 2021 in Education by JackTerrance
0 votes
    _________ term portrays the process of discovering small pieces from a large volume of raw material....
asked Nov 16, 2022 in Education by JackTerrance
0 votes
    Long story short...I have a base64 encoded string that I retrieve from a database. I need to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 28, 2022 in Education by JackTerrance
...