def docRetrieve(classNames, Queries, rootPath): search = BingSearch.bingSearch() for classname in classNames: category = '&NewsCategory=%27rt_' + classname + '%27' for query in Queries: toSavePath = rootPath+'\\'+classname+'\\' search.bing_search(query, category, toSavePath)
def docRetrieve(rootPath, queryWords): bingSearch = BingSearch.bingSearch() for word in queryWords: bingSearch.bing_search(word, "", rootPath)
for vertex in face.bounding_poly.vertices ]) print('face bounds: {}'.format(','.join(vertices))) print(type(face.bounding_poly.vertices)) xValues = [] yValues = [] for vertex in face.bounding_poly.vertices: xValues.append((vertex.x)) yValues.append((vertex.y)) print(xValues) print(yValues) width = xValues[1] - xValues[0] height = yValues[2] - yValues[1] size = (width, height) overlay = os.path.join(os.path.dirname(__file__), 'images/bing.jpg') image1 = Image.open(file_name) image2 = Image.open(overlay) image2 = image2.resize(size) image1.paste(image2, (xValues[0], yValues[0])) image1.show() BingSearch.GetImage('balloon')
from PIL import Image import BingSearch import pyperclip import helpers path1 = helpers.getImagePath('test2.jpg') BingSearch.GetImage('walnut') path2 = helpers.getImagePath('bing.jpg') image = helpers.objOnFace(path1, path2) image.show()