nprogram’s blog

気ままに、プログラミングのトピックについて書いていきます

2023-01-01から1年間の記事一覧

Selenium4

はじめに Selenium 4で参考になりそうな記事を集めます。 Using Proxies With Python Selenium Using Proxies With Python Selenium | ScrapeOps 【Python3】Selenium3⇒4にしたらProxy環境下で動作しなくなった話(解決) 【Python3】Selenium3⇒4にしたらProxy…

文字数カウントを作成する

文字数カウントする処理を記載します def count_characters_excluding(s, exclusions=(' ', ',')): """ 文字列sの中の文字数をカウントし、exclusionsに含まれる文字を除外します。 """ filtered_text = ''.join([char for char in s if char not in exclusi…

Azure Computer Visionを用いて、OCRを実行!

本記事について Azure Computer Visionを用いて、OCRを実行します。 コード import os import time from azure.cognitiveservices.vision.computervision import ComputerVisionClient from msrest.authentication import CognitiveServicesCredentials from…

Google Cloud Translationを用いて、各言語に同時に翻訳実行します

翻訳の自動化について 翻訳の自動化はGoogle Cloud Translation以外には、DeepLのAPIを用いることも可能です Google Translate Sample # Imports the Google Cloud Translation library from google.cloud import translate import pandas as pd # Initializ…

Google Cloud Vision API

Google Cloud Visionの設定について Cloud Vision の設定とクリーンアップ Google Cloud Vision APIサンプルコード 画像から文字列を抽出して、実際に取り出してきた値と期待値を比較して類似度を求めます import io import os import difflib from google.c…

Python + TesseractでOCR

はじめに PythonとTesseractでOCRを実施しようとした場合は、日本文字列をそのままOCRに書けるとあまり精度が出ません。 import os from PIL import Image from PIL import ImageEnhance import pyocr import cv2 import difflib def start_setting(): TESSE…