Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add headings to weights table. #6139

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from 11 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
8 changes: 6 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ def generate_weights_table(module, table_name, metrics, dataset, include_pattern
generated_dir = Path("generated")
generated_dir.mkdir(exist_ok=True)
with open(generated_dir / f"{table_name}_table.rst", "w+") as table_file:
table_file.write(f"{' '.join(table_name.split('_')).title()} Weights Table\n{(15 + len(table_name))*'^'}\n")
table_file.write(".. rst-class:: table-weights\n") # Custom CSS class, see custom_torchvision.css
table_file.write(".. table::\n")
table_file.write(f" :widths: 100 {'20 ' * len(metrics_names)} 20 10\n\n")
Expand All @@ -410,7 +411,7 @@ def generate_weights_table(module, table_name, metrics, dataset, include_pattern
)
generate_weights_table(
module=M.quantization,
table_name="classification_quant",
table_name="quantized_classification",
abhi-glitchhg marked this conversation as resolved.
Show resolved Hide resolved
metrics=[("acc@1", "Acc@1"), ("acc@5", "Acc@5")],
dataset="ImageNet-1K",
)
Expand Down Expand Up @@ -442,7 +443,10 @@ def generate_weights_table(module, table_name, metrics, dataset, include_pattern
dataset="COCO-val2017-VOC-labels",
)
generate_weights_table(
module=M.video, table_name="video", metrics=[("acc@1", "Acc@1"), ("acc@5", "Acc@5")], dataset="Kinetics-400"
module=M.video,
table_name="video_classification",
metrics=[("acc@1", "Acc@1"), ("acc@5", "Acc@5")],
dataset="Kinetics-400",
)


Expand Down
4 changes: 2 additions & 2 deletions docs/source/models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ Table of all available quantized classification weights

Accuracies are reported on ImageNet-1K using single crops:

.. include:: generated/classification_quant_table.rst
.. include:: generated/quantized_classification_table.rst

Semantic Segmentation
=====================
Expand Down Expand Up @@ -500,7 +500,7 @@ Table of all available video classification weights

Accuracies are reported on Kinetics-400 using single crops for clip length 16:

.. include:: generated/video_table.rst
.. include:: generated/video_classification_table.rst

Optical Flow
============
Expand Down