Commit
·
7aa3345
1
Parent(s):
1bf71b8
test
Browse files- .github/workflows/publish.yml +30 -0
- .gitignore +3 -1
- medvqa/cli.py +3 -5
- medvqa/competitions/gi-2025/task_1.py +19 -0
- medvqa/competitions/gi-2025/task_2.py +19 -0
.github/workflows/publish.yml
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: Upload Python Package to PyPI when a Release is Created
|
2 |
+
|
3 |
+
on:
|
4 |
+
release:
|
5 |
+
types: [created]
|
6 |
+
|
7 |
+
jobs:
|
8 |
+
pypi-publish:
|
9 |
+
name: Publish release to PyPI
|
10 |
+
runs-on: ubuntu-latest
|
11 |
+
environment:
|
12 |
+
name: pypi
|
13 |
+
url: https://pypi.org/p/medvqa
|
14 |
+
permissions:
|
15 |
+
id-token: write
|
16 |
+
steps:
|
17 |
+
- uses: actions/checkout@v4
|
18 |
+
- name: Set up Python
|
19 |
+
uses: actions/setup-python@v4
|
20 |
+
with:
|
21 |
+
python-version: "3.x"
|
22 |
+
- name: Install dependencies
|
23 |
+
run: |
|
24 |
+
python -m pip install --upgrade pip
|
25 |
+
pip install setuptools wheel
|
26 |
+
- name: Build package
|
27 |
+
run: |
|
28 |
+
python setup.py sdist bdist_wheel # Could also be python -m build
|
29 |
+
- name: Publish package distributions to PyPI
|
30 |
+
uses: pypa/gh-action-pypi-publish@release/v1
|
.gitignore
CHANGED
@@ -1,3 +1,5 @@
|
|
1 |
.venv
|
2 |
build
|
3 |
-
medvqa.egg-info
|
|
|
|
|
|
1 |
.venv
|
2 |
build
|
3 |
+
medvqa.egg-info
|
4 |
+
dist
|
5 |
+
.pypirc
|
medvqa/cli.py
CHANGED
@@ -6,7 +6,7 @@ import os
|
|
6 |
report = '''\n⚠️⚠️⚠️\n
|
7 |
Try installing latest version of the library by running the following command:
|
8 |
pip install git+https://github.com/SushantGautam/MedVQA.git
|
9 |
-
If you cannot solve the problem, don't hesitate to add an issue at https://github.com/SushantGautam/MedVQA/issues with the log above! We will try to solve the problem ASAP.\n
|
10 |
⚠️⚠️⚠️'''
|
11 |
|
12 |
|
@@ -17,8 +17,6 @@ def main():
|
|
17 |
help='Name of the competition (e.g., gi-2025)')
|
18 |
parser.add_argument('--task', type=str, required=True,
|
19 |
help='Task number (1 or 2)')
|
20 |
-
parser.add_argument('--submission_repo', type=str, required=True,
|
21 |
-
help='Path to the submission repository')
|
22 |
args, unknown = parser.parse_known_args()
|
23 |
|
24 |
# Dynamically find the base directory of the MedVQA library
|
@@ -30,12 +28,12 @@ def main():
|
|
30 |
raise FileNotFoundError(
|
31 |
f"Competition '{args.competition}' does not exist! Need to update library?"+report)
|
32 |
# Check if task file exists
|
33 |
-
task_file = os.path.join(competition_dir, f'task_{args.task}
|
34 |
if not os.path.isfile(task_file):
|
35 |
raise FileNotFoundError(
|
36 |
f"Task '{args.task}' does not exist! Need to update library?"+report)
|
37 |
subprocess.run(
|
38 |
-
['python', task_file
|
39 |
|
40 |
|
41 |
if __name__ == '__main__':
|
|
|
6 |
report = '''\n⚠️⚠️⚠️\n
|
7 |
Try installing latest version of the library by running the following command:
|
8 |
pip install git+https://github.com/SushantGautam/MedVQA.git
|
9 |
+
If you cannot solve the problem, don't hesitate to add an issue at https://github.com/SushantGautam/MedVQA/issues with the log above! We will try to solve the problem ASAP. Can also interact with us on Discord: https://discord.gg/22V9huwc3R.\n
|
10 |
⚠️⚠️⚠️'''
|
11 |
|
12 |
|
|
|
17 |
help='Name of the competition (e.g., gi-2025)')
|
18 |
parser.add_argument('--task', type=str, required=True,
|
19 |
help='Task number (1 or 2)')
|
|
|
|
|
20 |
args, unknown = parser.parse_known_args()
|
21 |
|
22 |
# Dynamically find the base directory of the MedVQA library
|
|
|
28 |
raise FileNotFoundError(
|
29 |
f"Competition '{args.competition}' does not exist! Need to update library?"+report)
|
30 |
# Check if task file exists
|
31 |
+
task_file = os.path.join(competition_dir, f'task_{args.task}.py')
|
32 |
if not os.path.isfile(task_file):
|
33 |
raise FileNotFoundError(
|
34 |
f"Task '{args.task}' does not exist! Need to update library?"+report)
|
35 |
subprocess.run(
|
36 |
+
['python', task_file] + unknown)
|
37 |
|
38 |
|
39 |
if __name__ == '__main__':
|
medvqa/competitions/gi-2025/task_1.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import sys
|
2 |
+
import argparse
|
3 |
+
|
4 |
+
|
5 |
+
def main(repo, verbose=False):
|
6 |
+
print("🌟 ImageCLEFmed-MEDVQA-GI-2025 🌟",
|
7 |
+
"https://github.com/simula/ImageCLEFmed-MEDVQA-GI-2025")
|
8 |
+
print("🔍 Subtask 1: Algorithm Development for Question Interpretation and Response")
|
9 |
+
print(f"Analyzing submission repository: {repo}")
|
10 |
+
if verbose:
|
11 |
+
print("Verbose mode is enabled")
|
12 |
+
|
13 |
+
|
14 |
+
if __name__ == '__main__':
|
15 |
+
parser = argparse.ArgumentParser(description='Run GI-1015 Task 1 (VQA)')
|
16 |
+
parser.add_argument('--submission_repo', type=str, required=True,
|
17 |
+
help='Path to the HF submission repository')
|
18 |
+
args, _ = parser.parse_known_args()
|
19 |
+
main(args.submission_repo)
|
medvqa/competitions/gi-2025/task_2.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import sys
|
2 |
+
import argparse
|
3 |
+
|
4 |
+
|
5 |
+
def main(repo, task_name, verbose=False):
|
6 |
+
print(f"Running {task_name} with repository: {repo}")
|
7 |
+
if verbose:
|
8 |
+
print("Verbose mode is enabled")
|
9 |
+
|
10 |
+
|
11 |
+
if __name__ == '__main__':
|
12 |
+
parser = argparse.ArgumentParser(description='Run GI-2025 Task 1 (VQA)')
|
13 |
+
parser.add_argument('repo2', type=str, help='Repository path')
|
14 |
+
parser.add_argument('task_name2', type=str, help='Name of the task')
|
15 |
+
parser.add_argument('--verbose2', action='store_true',
|
16 |
+
help='Enable verbose mode')
|
17 |
+
|
18 |
+
args = parser.parse_args()
|
19 |
+
main(args.repo2, args.task_name2, args.verbose2)
|