A python package to determine if an Image is an Advertisement
Project description
Detect Advertisement Images
Usage
pip install adlike
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 = ad_openai_clip_vitl_patch14_336()
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.4.tar.gz
(3.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file adlike-0.0.4.tar.gz.
File metadata
- Download URL: adlike-0.0.4.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33750ba1315b09d0487bac849435d97798ccd561bb9407410c3b0120d02fc51d
|
|
| MD5 |
f3e7d9417c2c181e80b9f28f50ce7d87
|
|
| BLAKE2b-256 |
881ce12e9c87efe51841d7b18b7989429dd3c342580bbee30454dd2ff93c4a8f
|
File details
Details for the file adlike-0.0.4-py3-none-any.whl.
File metadata
- Download URL: adlike-0.0.4-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9324b776d4e948e24ddf262df48f76eb2267ea74bb476eaba52a4b168b0db5bf
|
|
| MD5 |
2d600a59ddff2fe49c36c09380ee15b6
|
|
| BLAKE2b-256 |
69a80642334cb80dfe8621351b6283dedbcc640ed78abbe85a679d672c1ab1d6
|