Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

228
Visualizações
How can I make google vision APi detect only one language? (especially not to detect English!!)

I looked for answers to many similar questions.

Google Cloud Vision to detect only one language

And I found this page.

From what I understand, the way to solve this problem was:

      const result = await axios.post(
        `${API.TEXT_ENDPOINT}?key=${process.env.API_KEY}`,
        {
          requests: [
            {
              image: {
                content: canvas
                  .toDataURL()
                  .replace(/^data:image\/[a-z]+;base64,/, ""),
              },
              features: [
                {
                  type: "TEXT_DETECTION",
                  maxResults: 1,
                },
              ],
              imageContext: {
                languageHints: ["ko"],
              },
            },
          ],
        },
        {
          headers: {
            "Content-Type": "application/json",
          },
        },
      );

However, if I write this way, it seems that English is recognized unconditionally along with the language I have designated.

This page says;

List of languages to use for TEXT_DETECTION. In most cases, an empty value yields the best results since it enables automatic language detection. For languages based on the Latin alphabet, setting languageHints is not needed. In rare cases, when the language of the text in the image is known, setting a hint will help get better results (although it will be a significant hindrance if the hint is wrong). Text detection returns an error if one or more of the specified languages is not one of the supported languages.

How can I make the vision APi detect only one language? (especially not to detect English!!)

about 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda