This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from Google import Create_Service | |
import pandas as pd | |
working_dir = r'<>' | |
output_dir = os.path.join(working_dir, 'Output') | |
CLIENT_SECRET_FILE = r"client_secret.json" | |
API_SERVICE_NAME = 'drive' | |
API_VERSION = 'v3' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io, os | |
from google.cloud import vision | |
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = r"GoogleCloudDemo_ServiceAcct_Token.json" | |
client = vision.ImageAnnotatorClient() | |
file_name = 'cat.jpg' | |
image_path = os.path.join('.\images', file_name) | |
with io.open(image_path, 'rb') as image_file: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io, os | |
from numpy import random | |
from google.cloud import vision | |
from Pillow_Utility import draw_borders, Image | |
import pandas as pd | |
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = r"GoogleCloudDemo_ServiceAcct_Token.json" | |
client = vision.ImageAnnotatorClient() | |
file_name = 'ikea3.jpg' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image, ImageDraw, Image, ImageFont | |
""" | |
To install the Pillow library | |
pip install Pillow | |
""" | |
def draw_borders(pillow_image, bounding, color, image_size, caption='', confidence_score=0): | |
width, height = image_size | |
draw = ImageDraw.Draw(pillow_image) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, io | |
from draw_vertice import drawVertices | |
from google.cloud import vision | |
import pandas as pd | |
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = r'ServiceAccountToken.json' | |
client = vision.ImageAnnotatorClient() | |
file_name = 'test.jpg' | |
image_folder = './images/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io | |
from PIL import Image, ImageDraw, ImageFont | |
def drawVertices(image_source, vertices, display_text=''): | |
pillow_img = Image.open(io.BytesIO(image_source)) | |
draw = ImageDraw.Draw(pillow_img) | |
for i in range(len(vertices) - 1): | |
draw.line(((vertices[i].x, vertices[i].y), (vertices[i + 1].x, vertices[i + 1].y)), | |
fill='green', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import io | |
from google.cloud import vision | |
import pandas as pd | |
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = r"GoogleCloudDemo.json" | |
client = vision.ImageAnnotatorClient() | |
file_name = 'Chicago.jpg' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import io | |
from google.cloud import vision_v1 | |
import pandas as pd | |
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = r'ServiceAccountToken.json' | |
client = vision_v1.ImageAnnotatorClient() | |
def detect_landmark(file_path): | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, sys | |
import argparse | |
""" | |
Images uploaded with APIPrice per unit | |
First 500 images per monthfree | |
Next 9 500 image compressions $0.009 per image | |
After 10 000 image compressions$0.002 per image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub PrintActiveSheet() | |
Dim ws As Worksheet: Set ws = ThisWorkbook.ActiveSheet | |
With ws.PageSetup | |
.Orientation = xlLandscape | |
.Zoom = False | |
.FitToPagesTall = 1 | |
.FitToPagesWide = 1 | |
.PrintArea = "B1:R41" |