How to call for “Label Detection” and “Safe Search Detection” at a time on Google Cloud Vision API











up vote
0
down vote

favorite












I would like to ask you the the following thing about Vision API.



The following picture indicates that I can take on "Free with Label Detection, or $1.50", if I will use "Label Detection".
But, I didn't find out how to use both of them at the same time in a tutorial on "Label Detection" and "Safe Search Detection" both.




  1. Can I use both of services at a time in Python?

  2. If so, how can I call for them?


I will really appreciate that if you tell me.



enter image description here










share|improve this question


























    up vote
    0
    down vote

    favorite












    I would like to ask you the the following thing about Vision API.



    The following picture indicates that I can take on "Free with Label Detection, or $1.50", if I will use "Label Detection".
    But, I didn't find out how to use both of them at the same time in a tutorial on "Label Detection" and "Safe Search Detection" both.




    1. Can I use both of services at a time in Python?

    2. If so, how can I call for them?


    I will really appreciate that if you tell me.



    enter image description here










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I would like to ask you the the following thing about Vision API.



      The following picture indicates that I can take on "Free with Label Detection, or $1.50", if I will use "Label Detection".
      But, I didn't find out how to use both of them at the same time in a tutorial on "Label Detection" and "Safe Search Detection" both.




      1. Can I use both of services at a time in Python?

      2. If so, how can I call for them?


      I will really appreciate that if you tell me.



      enter image description here










      share|improve this question













      I would like to ask you the the following thing about Vision API.



      The following picture indicates that I can take on "Free with Label Detection, or $1.50", if I will use "Label Detection".
      But, I didn't find out how to use both of them at the same time in a tutorial on "Label Detection" and "Safe Search Detection" both.




      1. Can I use both of services at a time in Python?

      2. If so, how can I call for them?


      I will really appreciate that if you tell me.



      enter image description here







      python google-cloud-vision






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 7 at 18:51









      Ryohei De Iwata

      357




      357
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          In case you want to send both types at the same time, you can use the annotate_image() method; in this way, you can specify all the features that need to be included in the same request. Based on this, I recommend you to take a look on this documentation (Doc1, Doc2) to get detailed information about this property usage, as well as this tutorial, that contains a curl command example where is shown the process required to send multiple features within the same call that you can use as an alternative workaround.



          import io
          import os

          from google.cloud import vision

          client = vision.ImageAnnotatorClient()

          response = client.annotate_image({
          'image': {'source': {'image_uri': '<IMAGE_URI>'}},
          'features': [{'type': vision.enums.Feature.Type.SAFE_SEARCH_DETECTION},
          {'type': vision.enums.Feature.Type.LABEL_DETECTION}]
          })

          print(response)


          Additionally, I think that this pricing information refers that you can use the Safe Search Detection feature for free if you use it with Label Detection; however, the Label Detection requests will be billed with the corresponding charges that are displayed at the Prices document.






          share|improve this answer





















          • Thank you so much for your help. I will try what you told me.
            – Ryohei De Iwata
            Nov 8 at 16:31










          • My pleasure, let me know if it works for you.
            – Armin_SC
            Nov 8 at 16:37










          • I made it! Thank you so much! You have saved me!
            – Ryohei De Iwata
            Nov 8 at 22:46










          • Awesome! I'm glad it worked for you
            – Armin_SC
            Nov 8 at 22:47













          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53195930%2fhow-to-call-for-label-detection-and-safe-search-detection-at-a-time-on-googl%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote



          accepted










          In case you want to send both types at the same time, you can use the annotate_image() method; in this way, you can specify all the features that need to be included in the same request. Based on this, I recommend you to take a look on this documentation (Doc1, Doc2) to get detailed information about this property usage, as well as this tutorial, that contains a curl command example where is shown the process required to send multiple features within the same call that you can use as an alternative workaround.



          import io
          import os

          from google.cloud import vision

          client = vision.ImageAnnotatorClient()

          response = client.annotate_image({
          'image': {'source': {'image_uri': '<IMAGE_URI>'}},
          'features': [{'type': vision.enums.Feature.Type.SAFE_SEARCH_DETECTION},
          {'type': vision.enums.Feature.Type.LABEL_DETECTION}]
          })

          print(response)


          Additionally, I think that this pricing information refers that you can use the Safe Search Detection feature for free if you use it with Label Detection; however, the Label Detection requests will be billed with the corresponding charges that are displayed at the Prices document.






          share|improve this answer





















          • Thank you so much for your help. I will try what you told me.
            – Ryohei De Iwata
            Nov 8 at 16:31










          • My pleasure, let me know if it works for you.
            – Armin_SC
            Nov 8 at 16:37










          • I made it! Thank you so much! You have saved me!
            – Ryohei De Iwata
            Nov 8 at 22:46










          • Awesome! I'm glad it worked for you
            – Armin_SC
            Nov 8 at 22:47

















          up vote
          1
          down vote



          accepted










          In case you want to send both types at the same time, you can use the annotate_image() method; in this way, you can specify all the features that need to be included in the same request. Based on this, I recommend you to take a look on this documentation (Doc1, Doc2) to get detailed information about this property usage, as well as this tutorial, that contains a curl command example where is shown the process required to send multiple features within the same call that you can use as an alternative workaround.



          import io
          import os

          from google.cloud import vision

          client = vision.ImageAnnotatorClient()

          response = client.annotate_image({
          'image': {'source': {'image_uri': '<IMAGE_URI>'}},
          'features': [{'type': vision.enums.Feature.Type.SAFE_SEARCH_DETECTION},
          {'type': vision.enums.Feature.Type.LABEL_DETECTION}]
          })

          print(response)


          Additionally, I think that this pricing information refers that you can use the Safe Search Detection feature for free if you use it with Label Detection; however, the Label Detection requests will be billed with the corresponding charges that are displayed at the Prices document.






          share|improve this answer





















          • Thank you so much for your help. I will try what you told me.
            – Ryohei De Iwata
            Nov 8 at 16:31










          • My pleasure, let me know if it works for you.
            – Armin_SC
            Nov 8 at 16:37










          • I made it! Thank you so much! You have saved me!
            – Ryohei De Iwata
            Nov 8 at 22:46










          • Awesome! I'm glad it worked for you
            – Armin_SC
            Nov 8 at 22:47















          up vote
          1
          down vote



          accepted







          up vote
          1
          down vote



          accepted






          In case you want to send both types at the same time, you can use the annotate_image() method; in this way, you can specify all the features that need to be included in the same request. Based on this, I recommend you to take a look on this documentation (Doc1, Doc2) to get detailed information about this property usage, as well as this tutorial, that contains a curl command example where is shown the process required to send multiple features within the same call that you can use as an alternative workaround.



          import io
          import os

          from google.cloud import vision

          client = vision.ImageAnnotatorClient()

          response = client.annotate_image({
          'image': {'source': {'image_uri': '<IMAGE_URI>'}},
          'features': [{'type': vision.enums.Feature.Type.SAFE_SEARCH_DETECTION},
          {'type': vision.enums.Feature.Type.LABEL_DETECTION}]
          })

          print(response)


          Additionally, I think that this pricing information refers that you can use the Safe Search Detection feature for free if you use it with Label Detection; however, the Label Detection requests will be billed with the corresponding charges that are displayed at the Prices document.






          share|improve this answer












          In case you want to send both types at the same time, you can use the annotate_image() method; in this way, you can specify all the features that need to be included in the same request. Based on this, I recommend you to take a look on this documentation (Doc1, Doc2) to get detailed information about this property usage, as well as this tutorial, that contains a curl command example where is shown the process required to send multiple features within the same call that you can use as an alternative workaround.



          import io
          import os

          from google.cloud import vision

          client = vision.ImageAnnotatorClient()

          response = client.annotate_image({
          'image': {'source': {'image_uri': '<IMAGE_URI>'}},
          'features': [{'type': vision.enums.Feature.Type.SAFE_SEARCH_DETECTION},
          {'type': vision.enums.Feature.Type.LABEL_DETECTION}]
          })

          print(response)


          Additionally, I think that this pricing information refers that you can use the Safe Search Detection feature for free if you use it with Label Detection; however, the Label Detection requests will be billed with the corresponding charges that are displayed at the Prices document.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 8 at 16:11









          Armin_SC

          82427




          82427












          • Thank you so much for your help. I will try what you told me.
            – Ryohei De Iwata
            Nov 8 at 16:31










          • My pleasure, let me know if it works for you.
            – Armin_SC
            Nov 8 at 16:37










          • I made it! Thank you so much! You have saved me!
            – Ryohei De Iwata
            Nov 8 at 22:46










          • Awesome! I'm glad it worked for you
            – Armin_SC
            Nov 8 at 22:47




















          • Thank you so much for your help. I will try what you told me.
            – Ryohei De Iwata
            Nov 8 at 16:31










          • My pleasure, let me know if it works for you.
            – Armin_SC
            Nov 8 at 16:37










          • I made it! Thank you so much! You have saved me!
            – Ryohei De Iwata
            Nov 8 at 22:46










          • Awesome! I'm glad it worked for you
            – Armin_SC
            Nov 8 at 22:47


















          Thank you so much for your help. I will try what you told me.
          – Ryohei De Iwata
          Nov 8 at 16:31




          Thank you so much for your help. I will try what you told me.
          – Ryohei De Iwata
          Nov 8 at 16:31












          My pleasure, let me know if it works for you.
          – Armin_SC
          Nov 8 at 16:37




          My pleasure, let me know if it works for you.
          – Armin_SC
          Nov 8 at 16:37












          I made it! Thank you so much! You have saved me!
          – Ryohei De Iwata
          Nov 8 at 22:46




          I made it! Thank you so much! You have saved me!
          – Ryohei De Iwata
          Nov 8 at 22:46












          Awesome! I'm glad it worked for you
          – Armin_SC
          Nov 8 at 22:47






          Awesome! I'm glad it worked for you
          – Armin_SC
          Nov 8 at 22:47




















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53195930%2fhow-to-call-for-label-detection-and-safe-search-detection-at-a-time-on-googl%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          Academy of Television Arts & Sciences

          L'Équipe

          1995 France bombings