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

[Fix] fix model_zoo script #1666

Merged
merged 3 commits into from
Mar 2, 2023
Merged
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
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,13 @@ repos:
- id: check-copyright
args: ["demo", "mmedit", "tests", "tools"]
- id: remove-improper-eol-in-cn-docs
- repo: local
hooks:
- id: update-model-zoo
name: update-model-zoo
description: update model-zoo.yml
entry: docs/en/.dev_scripts/update_model_zoo.py
additional_dependencies: [mmengine, modelindex, tqdm, rich]
language: python
files: ^configs/.*\.md$
require_serial: true
46 changes: 0 additions & 46 deletions configs/guided_diffusion/adm-u_8xb32_imagenet-512x512.py

This file was deleted.

9 changes: 5 additions & 4 deletions docs/en/.dev_scripts/update_model_zoo.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python
import os
from glob import glob
from os import path as osp
Expand Down Expand Up @@ -52,9 +53,9 @@ def update_model_zoo():
papers = set()
checkpoints = set()
for m in full_models:
papers.update(m.paper)
papers.add(m.paper['Title'])
if m.weights is not None and m.weights.startswith('https:'):
checkpoints.update(m.weights)
checkpoints.add(m.weights)
task_desc = '\n'.join([
f" - [{t}]({t.replace('-', '_').replace(' ', '_')}.md)"
for t in list(tasks.keys())
Expand Down Expand Up @@ -90,12 +91,12 @@ def update_model_zoo():
checkpoints = set()
for m in models:
if m.weights is not None and m.weights.startswith('https:'):
checkpoints.update(m.weights)
checkpoints.add(m.weights)
collections = set([m.in_collection for m in models])

papers = set()
for m in models:
papers.update(m.paper)
papers.add(m.paper['Title'])

content = ''
readme = set()
Expand Down