Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .isort.cfg

This file was deleted.

22 changes: 8 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
repos:
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.3.7
hooks:
- id: isort
- repo: https://github.com/ambv/black
rev: 23.1.0
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies:
- 'flake8-coding==1.3.2'
- 'flake8-debugger==4.1.2'
# Run the linter.
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
# Run the formatter.
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
Expand Down
6 changes: 3 additions & 3 deletions doc_ufcn/train/evaluate.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-

"""
The evaluation module
======================
The evaluation module
======================

Use it to evaluation a trained network.
Use it to evaluation a trained network.
"""

import logging
Expand Down
6 changes: 3 additions & 3 deletions doc_ufcn/train/experiment.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-

"""
The run experiment module
======================
The run experiment module
======================

Use it to train, predict and evaluate a model.
Use it to train, predict and evaluate a model.
"""

import logging
Expand Down
6 changes: 3 additions & 3 deletions doc_ufcn/train/normalization_params.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-

"""
The normalization params module
======================
The normalization params module
======================

Use it to get the mean and standard deviation of the training set.
Use it to get the mean and standard deviation of the training set.
"""

import logging
Expand Down
6 changes: 3 additions & 3 deletions doc_ufcn/train/predict.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-

"""
The predict module
======================
The predict module
======================

Use it to predict some images from a trained network.
Use it to predict some images from a trained network.
"""

import logging
Expand Down
6 changes: 3 additions & 3 deletions doc_ufcn/train/training.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-

"""
The train module
======================
The train module
======================

Use it to train a model.
Use it to train a model.
"""

import logging
Expand Down
6 changes: 3 additions & 3 deletions doc_ufcn/train/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-

"""
The utils module
======================
The utils module
======================

Generic functions used during all the steps.
Generic functions used during all the steps.
"""

import copy
Expand Down
6 changes: 3 additions & 3 deletions doc_ufcn/train/utils/evaluation.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-

"""
The evaluation utils module
======================
The evaluation utils module
======================

Use it to during the evaluation stage.
Use it to during the evaluation stage.
"""

import json
Expand Down
18 changes: 9 additions & 9 deletions doc_ufcn/train/utils/object_metrics.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# -*- coding: utf-8 -*-

"""
The object metrics module
======================

Use it to compute different metrics during evaluation.
Available metrics:
- Precision
- Recall
- F-score
- Average precision
The object metrics module
======================

Use it to compute different metrics during evaluation.
Available metrics:
- Precision
- Recall
- F-score
- Average precision
"""

import numpy as np
Expand Down
16 changes: 8 additions & 8 deletions doc_ufcn/train/utils/pixel_metrics.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# -*- coding: utf-8 -*-

"""
The pixel metrics module
======================
The pixel metrics module
======================

Use it to compute different metrics during evaluation.
Available metrics:
- Intersection-over-Union
- Precision
- Recall
- F-score
Use it to compute different metrics during evaluation.
Available metrics:
- Intersection-over-Union
- Precision
- Recall
- F-score
"""

import numpy as np
Expand Down
6 changes: 3 additions & 3 deletions doc_ufcn/train/utils/prediction.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-

"""
The prediction utils module
======================
The prediction utils module
======================

Use it to during the prediction stage.
Use it to during the prediction stage.
"""

import json
Expand Down
6 changes: 3 additions & 3 deletions doc_ufcn/train/utils/preprocessing.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-

"""
The preprocessing module
======================
The preprocessing module
======================

Use it to preprocess the images.
Use it to preprocess the images.
"""

import os
Expand Down
6 changes: 3 additions & 3 deletions doc_ufcn/train/utils/training.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-

"""
The training utils module
======================
The training utils module
======================

Use it to during the training stage.
Use it to during the training stage.
"""

import matplotlib.pyplot as plt
Expand Down
12 changes: 6 additions & 6 deletions doc_ufcn/train/utils/training_pixel_metrics.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# -*- coding: utf-8 -*-

"""
The training pixel metrics module
======================
The training pixel metrics module
======================

Use it to compute different metrics during training.
Available metrics:
- Confusion matrix
- Intersection-over-Union
Use it to compute different metrics during training.
Available metrics:
- Confusion matrix
- Intersection-over-Union
"""

import numpy as np
Expand Down
4 changes: 2 additions & 2 deletions hugging_face/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ def load(self):
self.classes = parameters["classes"]

# Check that the number of colors is equal to the number of classes -1
assert self.num_channels - 1 == len(
self.colors
assert (
self.num_channels - 1 == len(self.colors)
), f"The parameter classes_colors was filled with the wrong number of colors. {self.num_channels-1} colors are expected instead of {len(self.colors)}."

# Load the model
Expand Down
26 changes: 26 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,29 @@ test = [

[tool.setuptools.packages]
find = {}

[tool.ruff]
exclude = [".git", "__pycache__"]

[tool.ruff.lint.isort]
known-third-party = [
"PIL",
"cv2",
"gradio",
"huggingface_hub",
"imageio",
"matplotlib",
"mlflow",
"numpy",
"pytest",
"requests",
"setuptools",
"shapely",
"skimage",
"teklia_toolbox",
"torch",
"torchvision",
"tqdm",
"yaml",
]

6 changes: 3 additions & 3 deletions tools/training-csv-config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# -*- coding: utf-8 -*-

"""
The retrieve experiments configs module
======================
The retrieve experiments configs module
======================

Use it to get the configurations for running the experiments.
Use it to get the configurations for running the experiments.
"""

import argparse
Expand Down