Skip to main content

A python package to determine if an Image is an Advertisement

Project description

Detect Advertisement Images

Usage


import requests
from PIL import Image

from adlike import ad_openai_clip_vitl_patch14_336

device = "cuda" if torch.cuda.is_available() else "cpu"
model, preprocess = clip.load("ViT-B/32", device=device)

url = "https://literacyideas.com/wp-content/uploads/2021/08/christmas_advertising.jpg"
image = Image.open(requests.get(url, stream=True).raw)


with torch.no_grad():
    image = preprocess(img).to(device).unsqueeze(0)
    probs = model(image)

print("Label probs:", probs)  # prints: tensor([[0.9753]])

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

adlike-0.0.2.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

adlike-0.0.2-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file adlike-0.0.2.tar.gz.

File metadata

  • Download URL: adlike-0.0.2.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for adlike-0.0.2.tar.gz
Algorithm Hash digest
SHA256 d8f1e3e85f4ee55332a8f0a32560bf6d6146548b87126c708b00cf1d1bfdf1c6
MD5 12d60e6aeedba4221dfe311d4999f64f
BLAKE2b-256 730f9bdaac135d66aca862e22c9240ad52974d22aee8dd3eee86d2e85005698b

See more details on using hashes here.

File details

Details for the file adlike-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: adlike-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for adlike-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2750bf9a8f77402e3d333375e84140f08144309ed9fd313a3bb2c6df83a17cf3
MD5 13c602ca69cd7399314ec1c5bb169f39
BLAKE2b-256 c52e85f088df375c68e503358829f278aa7cb694fe281e5b1bd67840264263ca

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page