Skip to main content

Back-end of application - C# and the Google Vision API



In this post I will be writing about following:

  • Connecting the Google Cloud Vision API to C#,
  • benefits of using this API,
  • why I choose the Vision API,
  • code written to make my software working,
  • bugs that I need to solve in future versions
Connecting API to C#
To use Google Cloud API's we need to configure and download account credential '*.JSON' file. To work with the Google Vision API we need also to reconfigure our windows settings by adding path of JSON file to our environmental variables, which you can see below



As we finish adding our environmental variable we can go further to the next step, which is preparing our programming language to work with API, in this case C#. Firstly, I have downloaded NuGet Google Cloud package to work it


Secondly, after we configured everything successful we can import Google package to call it after in code. To do that in C# we need following 'using' statement


With this last step I am fully configured to start working with Google Cloud Vision API in my code.


Benefits of using Google Cloud
Using this software developed by Google we can gain useful experience, but this is not the only advantage. Further, we gaining access to cloud dashboard and this feature is beneficial as we can follow all API calls, bugs and overall we can track the traffic in the application.



Why I choose Google Cloud Vision API 
I choose this service, because it allows me to work quickly with Artificial Intelligence and that was the key point for me when I was deciding to make this project. From logging into the Dashboard and configuring API to make a working basic software it took me around 3 working hours. With my knowledge so far making software like this can potentially took 1-3 months and probably would not be fully working. Furthermore, if I will be willing to add more features in future I know that would be simple with this API. These are the main reasons why I choose Vision API over making my own standalone AI.


Code written in C#



This code have minor defects, which I am aware of. However, as this is the first version and this program will be running in isolated environment I do not need to implement catching exceptions and other important things that should normally be here. As I mentioned before it was important for me to finish my first version as soon as possible and also to have a decent comments in code.


Bugs to solve
During testing my application I found following bugs:

  • Google responses are limited to 10 whilst there should be more,
  • application getting stuck while it gets responses from Google Cloud
Furthermore, I found that Google API is not always as that accurate as I wish it to be and for that reason I was forced to implement adding labels whether label contain following elements:
  • fruit,
  • food,
  • plant,
  • tree
instead of just fruit. 


To conclude, I am happy with easiness of configuring Google Vision API to work with C# and with features that this service provides for developers. Moreover, I explained the benefits of using API like this and I covered why to choose API over making own AI software from beginning. Also I shared my code and presented bugs in my code.

Comments

  1. A very detailed and in-depth blog post that shows your progress with images as well as description. You have also added a nice bit of reflection at the end which identifies areas of success and progression as well as some issues that need resolving. Great work.

    ReplyDelete

Post a Comment

Popular posts from this blog

Survey results and analysis + SWOT Analysis

In the last weeks I have created a survey to gather informations, which can potentially give me some ideas about my software and how I can improve it in order to fulfil expectations of potential clients. To analyse all of data gathered I used charts that were generated automatically in the Google Forms and SWOT Analysis of data in charts. In the first part of my survey I am asking respondents about themselves do predict if there are any chances that they are on some higher positions in companies that they are working for. The variation of both higher age and higher education - age 30+ and bachelors level of education and above makes possibilities that the respondent is currently on some higher position. I decided to use this variation instead of asking respondent directly, because I am aware of that maybe not everyone want to share such information with survey even if they are anonymous. As we are able to see on the chart there is an impressive number of people who have educati...