-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathultraswin_test_for_pediatrics.py
88 lines (56 loc) · 1.75 KB
/
ultraswin_test_for_pediatrics.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# -*- coding: utf-8 -*-
"""UltraSwin Test for pediatrics
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1k3Tsu1c5__hDS8kME4xZx_cYcDI8oGR2
# Persiapan
## Menyiapkan Dataset
### Download dataset
Instalasi gdown untuk mendownload file dari Google Drive
"""
!pip install gdown
from google.colab import drive
drive.mount('/content/drive')
"""Download dataset"""
!gdown 1LFxNbvbHEKEuLcCtpMNeG3B62LIh7fNe
"""### Extract Dataset
Harap menunggu beberapa saat, proses ekstraksi dataset memakan waktu kurang lebih 4 menit.
"""
!unzip -q A4C.zip
"""Hapus file EchoNet-Dynamic.zip"""
!rm A4C.zip
"""## Clone Project"""
!git clone https://github.com/lhfazry/UltraSwin
"""## Pindah Direktory ke UltraSwin"""
# Commented out IPython magic to ensure Python compatibility.
# %cd UltraSwin
"""## Instalasi Library"""
!pip install -r requirements_pip.txt
"""# Test UltraSwin-base"""
!pip install pytorch_lightning==1.6.4
"""## Download Pre-trained Model"""
!gdown 1ANB1NdKW8trQ9UvwtToN8z6cTnuv2Ii4
"""## Melakukan Test"""
# Commented out IPython magic to ensure Python compatibility.
# %run main.py \
--mode=test \
--data_dir=/content/EchoNet-Dynamic \
--ckpt_path=UltraSwin-base-epoch=19-step=17920.ckpt \
--batch_size=8 \
--num_workers=4 \
--accelerator=gpu \
--variant=base
"""# Test UltraSwin-small
## Download Pre-trained Model
"""
!gdown 14RT5eYfsBd7EF0aIlcuaODDFGhzU8mB1
"""## Melakukan Test"""
# Commented out IPython magic to ensure Python compatibility.
# %run main.py \
--mode=test \
--data_dir=/content/EchoNet-Dynamic \
--ckpt_path=UltraSwin-small-epoch=19-step=8960.ckpt \
--batch_size=8 \
--num_workers=4 \
--accelerator=gpu \
--variant=small