pic_scanner.models.of_interest.concern

Attributes

PARENT_LOGGER

MOD_LOGGER

Classes

OfInterest

A metaclass to enhance classes with logging capabilities. Classes that inherit from

Concern

A class detailing a NSFW concern (or 'detection') found on an image.

Module Contents

pic_scanner.models.of_interest.concern.PARENT_LOGGER
class pic_scanner.models.of_interest.concern.OfInterest(name: str, score: float, location: list[int], description: str | None = None)

Bases: pic_scanner.log_engine.Loggable

A metaclass to enhance classes with logging capabilities. Classes that inherit from ‘Loggable’ can instantly access a logger without manually setting it up. This logger is derived from a parent logger, ensuring consistent logging behavior and hierarchy.

Parameters:
  • name (str)

  • score (float)

  • location (list[int])

  • description (Optional[str])

- log_device

The logger device associated with the instance of the class.

description
Return type:

Optional[str]

location
Return type:

list[int]

score
Return type:

float

name
Return type:

str

property score_percentage: float

Return the score of the concern as a percentage.

Returns:

The score of the concern as a percentage.

Return type:

float

property score: float

Return the score of the concern.

Returns:

The score of the concern.

Return type:

float

property score_percentage_str: str

Return the score of the concern as a percentage string.

Returns:

The score of the concern as a percentage string.

Return type:

str

property name: str

Return the name of the concern.

Returns:

The name of the concern.

Return type:

str

property description: str | None

Return the description of the concern.

Returns:

The description of the concern.

Return type:

Optional[str]

property location: list[int]

Return the location of the concern.

Returns:

The location of the concern.

Return type:

list[int]

pic_scanner.models.of_interest.concern.MOD_LOGGER
class pic_scanner.models.of_interest.concern.Concern(name: str, score: float, location: list[int], description: str | None = None)

Bases: pic_scanner.models.of_interest.OfInterest

A class detailing a NSFW concern (or ‘detection’) found on an image.

Parameters:
  • name (str)

  • score (float)

  • location (list[int])

  • description (Optional[str])

name

The name of the concern.

Return type:

str

score

The score of the concern.

Return type:

float

location

The location of the concern.

Return type:

list[int]

description

The description of the concern.

Return type:

Optional[str]