Skip to main content

CNN Attention layer to be used with tf or tf.keras

Project description

Visual_attention_tf

A set of image attention layers implemented as custom keras layers that can be imported dirctly into keras

Currently Implemented layers:

Usage:

from tensorflow.keras.models import Model
from tensorflow.keras.layers import Input, Conv2D
from visual_attention import PixelAttention2D , ChannelAttention2D

inp = Input(shape=(1920,1080,3))
cnn_layer = Conv2D(32,3,,activation='relu', padding='same')(inp)

# Using the .shape[-1] to simplify network modifications. Can directly input number of channels as well
Pixel_attention_cnn = PixelAttention2D(cnn_layer.shape[-1])(cnn_layer)
Channel_attention_cnn = ChannelAttention2D(cnn_layer.shape[-1])(cnn_layer)

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

visual-attention-tf-1.0.3.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

visual_attention_tf-1.0.3-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file visual-attention-tf-1.0.3.tar.gz.

File metadata

  • Download URL: visual-attention-tf-1.0.3.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.6.12

File hashes

Hashes for visual-attention-tf-1.0.3.tar.gz
Algorithm Hash digest
SHA256 75c0cd51a56610b8ecb23a805e7f1968aea13bf0fa9630ffc1bb941d01d57543
MD5 bf15503bd5a03ac94b08271fe7a8921a
BLAKE2b-256 cd56d34e7fc0ef13b54fd6762e69400ecaeced0e0826809513a127abad80d0f8

See more details on using hashes here.

File details

Details for the file visual_attention_tf-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: visual_attention_tf-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.6.12

File hashes

Hashes for visual_attention_tf-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 53fd96682b6d23a9434676b088461763850dc54955369bc44b0e76f457f7c819
MD5 89fb607e6cc05306bbfc12d656c374c2
BLAKE2b-256 d95aa38d3099026436cab219715088c87e9a42756f69de7377219930b9e9ba01

See more details on using hashes here.

Supported by

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