change to iptc
This commit is contained in:
parent
3db5a8502c
commit
b443483ff4
2 changed files with 5 additions and 1 deletions
|
@ -14,6 +14,7 @@ import click_config_file
|
||||||
from logging.handlers import SysLogHandler
|
from logging.handlers import SysLogHandler
|
||||||
import face_recognition
|
import face_recognition
|
||||||
import exif
|
import exif
|
||||||
|
from iptcinfo3 import IPTCInfo
|
||||||
import PIL
|
import PIL
|
||||||
|
|
||||||
class CustomFormatter(logging.Formatter):
|
class CustomFormatter(logging.Formatter):
|
||||||
|
@ -69,6 +70,8 @@ class image_classifier:
|
||||||
if people:
|
if people:
|
||||||
self._log.debug(f"Found {len(people)} known people in the image.")
|
self._log.debug(f"Found {len(people)} known people in the image.")
|
||||||
self._log.debug(json.dumps(people, indent=2))
|
self._log.debug(json.dumps(people, indent=2))
|
||||||
|
iptc_info = IPTCInfo(file)
|
||||||
|
print(iptc_info['keywords'])
|
||||||
with open(file, 'rb') as image_file:
|
with open(file, 'rb') as image_file:
|
||||||
self.exif_info = exif.Image(image_file)
|
self.exif_info = exif.Image(image_file)
|
||||||
if not self.exif_info.has_exif:
|
if not self.exif_info.has_exif:
|
||||||
|
|
|
@ -2,3 +2,4 @@ click
|
||||||
click_config_file
|
click_config_file
|
||||||
face_recognition
|
face_recognition
|
||||||
exif
|
exif
|
||||||
|
iptcinfo3
|
Loading…
Reference in a new issue