Skip to content
Snippets Groups Projects
Unverified Commit fee9392a authored by Yoann Schneider's avatar Yoann Schneider :tennis:
Browse files

Define dedicated logger for each module

parent 588c5afb
No related branches found
No related tags found
1 merge request!264Define dedicated logger for each module
...@@ -5,4 +5,3 @@ logging.basicConfig( ...@@ -5,4 +5,3 @@ logging.basicConfig(
level=logging.INFO, level=logging.INFO,
format="%(asctime)s %(levelname)s/%(name)s: %(message)s", format="%(asctime)s %(levelname)s/%(name)s: %(message)s",
) )
logger = logging.getLogger(__name__)
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import logging
from collections import Counter, defaultdict from collections import Counter, defaultdict
from pathlib import Path from pathlib import Path
from typing import Dict, List, Optional from typing import Dict, List, Optional
...@@ -8,7 +9,7 @@ import numpy as np ...@@ -8,7 +9,7 @@ import numpy as np
from mdutils.mdutils import MdUtils from mdutils.mdutils import MdUtils
from prettytable import MARKDOWN, PrettyTable from prettytable import MARKDOWN, PrettyTable
from dan import logger logger = logging.getLogger(__name__)
METRIC_COLUMN = "Metric" METRIC_COLUMN = "Metric"
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import json import json
import logging
import pickle import pickle
import random import random
from collections import defaultdict from collections import defaultdict
...@@ -12,7 +13,6 @@ import numpy as np ...@@ -12,7 +13,6 @@ import numpy as np
from tqdm import tqdm from tqdm import tqdm
from arkindex_export import open_database from arkindex_export import open_database
from dan import logger
from dan.datasets.extract.db import ( from dan.datasets.extract.db import (
Element, Element,
get_elements, get_elements,
...@@ -37,6 +37,7 @@ IMAGES_DIR = "images" # Subpath to the images directory. ...@@ -37,6 +37,7 @@ IMAGES_DIR = "images" # Subpath to the images directory.
SPLIT_NAMES = ["train", "val", "test"] SPLIT_NAMES = ["train", "val", "test"]
IIIF_URL_SUFFIX = "/full/full/0/default.jpg" IIIF_URL_SUFFIX = "/full/full/0/default.jpg"
logger = logging.getLogger(__name__)
class ArkindexExtractor: class ArkindexExtractor:
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import logging
import re import re
from typing import List, Tuple from typing import List, Tuple
...@@ -8,7 +9,7 @@ import torch ...@@ -8,7 +9,7 @@ import torch
from PIL import Image from PIL import Image
from torchvision.transforms.functional import to_pil_image from torchvision.transforms.functional import to_pil_image
from dan import logger logger = logging.getLogger(__name__)
def parse_delimiters(delimiters: List[str]) -> re.Pattern: def parse_delimiters(delimiters: List[str]) -> re.Pattern:
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import json import json
import logging
import pickle import pickle
import re import re
from itertools import pairwise from itertools import pairwise
...@@ -11,7 +12,6 @@ import numpy as np ...@@ -11,7 +12,6 @@ import numpy as np
import torch import torch
import yaml import yaml
from dan import logger
from dan.ocr.decoder import GlobalHTADecoder from dan.ocr.decoder import GlobalHTADecoder
from dan.ocr.encoder import FCN_Encoder from dan.ocr.encoder import FCN_Encoder
from dan.ocr.predict.attention import ( from dan.ocr.predict.attention import (
...@@ -29,6 +29,8 @@ from dan.utils import ( ...@@ -29,6 +29,8 @@ from dan.utils import (
read_image, read_image,
) )
logger = logging.getLogger(__name__)
class DAN: class DAN:
""" """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment