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

Bump precommit hooks and fix files accordingly

parent 2fb22363
No related branches found
No related tags found
1 merge request!86Bump precommit hooks and fix files accordingly
Pipeline #72360 passed
repos:
- repo: https://github.com/asottile/seed-isort-config
rev: v2.2.0
hooks:
- id: seed-isort-config
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.10.1
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/ambv/black
rev: 22.3.0
rev: 23.1.0
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 3.9.2
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies:
- 'flake8-coding==1.3.1'
- 'flake8-copyright==0.2.2'
- 'flake8-debugger==3.1.0'
- 'flake8-coding==1.3.2'
- 'flake8-debugger==4.1.2'
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.4.0
hooks:
- id: check-ast
- id: check-docstring-first
......@@ -37,7 +32,7 @@ repos:
- id: check-json
- id: requirements-txt-fixer
- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
rev: v2.2.2
hooks:
- id: codespell
args: ['--write-changes']
......
......@@ -30,7 +30,6 @@ def parse_args():
def main():
args = parse_args()
# Parse all configuration files provided from CLI
......
......@@ -67,7 +67,6 @@ def create_buckets(images_sizes, bin_size):
class Sampler(torch.utils.data.Sampler):
def __init__(self, data, bin_size=20, batch_size=None, nb_params=None):
self.bin_size = bin_size
self.batch_size = batch_size
self.nb_params = nb_params
......
......@@ -116,7 +116,6 @@ def query_image(image):
with gr.Blocks() as process_image:
# Create app title
gr.Markdown(f"# {config['title']}")
......@@ -125,16 +124,13 @@ with gr.Blocks() as process_image:
# Create a first row of blocks
with gr.Row():
# Create a column on the left
with gr.Column():
# Generates an image that can be uploaded by a user
image = gr.Image()
# Create a row under the image
with gr.Row():
# Generate a button to clear the inputs and outputs
clear_button = gr.Button("Clear", variant="secondary")
......@@ -143,25 +139,20 @@ with gr.Blocks() as process_image:
# Create a row under the buttons
with gr.Row():
# Generate example images that can be used as input image
examples = gr.Examples(inputs=image, examples=config["examples"])
# Create a column on the right
with gr.Column():
# Generates an output image that does not support upload
image_output = gr.Image(interactive=False)
# Create a row under the predicted image
with gr.Row():
# Create a column so that the JSON output doesn't take the full size of the page
with gr.Column():
# Create a collapsible region
with gr.Accordion("JSON"):
# Generates a json with the model predictions
json_output = gr.JSON()
......
......@@ -40,7 +40,6 @@ def generate_configurations(csv_path):
reader = csv.DictReader(csv_path.open(), delimiter=",")
for row in reader:
config = {}
# Get experiment name.
assert row["experiment_name"] != "", "Missing experiment name"
......@@ -87,7 +86,6 @@ def run(csv_path, output):
os.makedirs(output, exist_ok=True)
for index, config in enumerate(generate_configurations(csv_path), 1):
# Save each configuration in a dedicated file file.
json_file = str(index) + "_" + config["experiment_name"] + ".json"
with open(os.path.join(output, json_file), "w") as file:
......
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