sosigikiller commited on
Commit
f8cea41
Β·
1 Parent(s): 5df9707

change_folder

Browse files
.idea/.gitignore ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ # λ””ν΄νŠΈ λ¬΄μ‹œλœ 파일
2
+ /shelf/
3
+ /workspace.xml
.idea/CSATv2.iml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="PYTHON_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$" />
5
+ <orderEntry type="jdk" jdkName="Python 3.6" jdkType="Python SDK" />
6
+ <orderEntry type="sourceFolder" forTests="false" />
7
+ </component>
8
+ <component name="PyDocumentationSettings">
9
+ <option name="format" value="GOOGLE" />
10
+ <option name="myDocStringFormat" value="Google" />
11
+ </component>
12
+ </module>
.idea/inspectionProfiles/profiles_settings.xml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ <component name="InspectionProjectProfileManager">
2
+ <settings>
3
+ <option name="USE_PROJECT_PROFILE" value="false" />
4
+ <version value="1.0" />
5
+ </settings>
6
+ </component>
.idea/misc.xml ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="Black">
4
+ <option name="sdkName" value="Python 3.6" />
5
+ </component>
6
+ <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6" project-jdk-type="Python SDK" />
7
+ </project>
.idea/modules.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/CSATv2.iml" filepath="$PROJECT_DIR$/.idea/CSATv2.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="Git" />
5
+ </component>
6
+ </project>
model/CSAT.py β†’ CSAT.py RENAMED
File without changes
weight/CSAT_ImageNet.pth.tar β†’ CSAT_ImageNet.pth.tar RENAMED
File without changes
weight/CSAT_RCKD.pth.tar β†’ CSAT_RCKD.pth.tar RENAMED
File without changes
weight/CSAT_v2_ImageNet.pth.tar β†’ CSAT_v2_ImageNet.pth.tar RENAMED
File without changes
model/CSATv2.py β†’ CSATv2.py RENAMED
File without changes
model/DCT.py β†’ DCT.py RENAMED
File without changes
model/ResNet18.py β†’ ResNet18.py RENAMED
File without changes
weight/ResNet18_RCKD.pth.tar β†’ ResNet18_RCKD.pth.tar RENAMED
File without changes
example.py CHANGED
@@ -5,7 +5,7 @@ from model.CSATv2 import CSATv2
5
  from torch import nn
6
 
7
  img_size = 224
8
- path = r'./weight/CSAT_ImageNet.pth.tar' #or CSAT_RCKD.pth.tar <- for pathological image analysis
9
  model = CSAT(img_size=img_size)
10
  state = torch.load(path, map_location='cpu')
11
  model.load_state_dict(state)
@@ -14,7 +14,7 @@ model.head = nn.Identity()
14
  output = model(data)#b, c = 1, 176
15
  print(output.shape)
16
 
17
- path = r'./weight/ResNet18_RCKD.pth.tar'
18
  model = ResNet18()
19
  state = torch.load(path, map_location='cpu')
20
  model.load_state_dict(state)
@@ -23,11 +23,11 @@ model.fc = nn.Identity()
23
  output = model(data)#b, c = 1, 512
24
  print(output.shape)
25
 
26
- path = r'./weight/CSAT_v2_ImageNet.pth.tar'
27
  model = CSATv2(img_size=img_size)
28
  state = torch.load(path, map_location='cpu')
29
  model.load_state_dict(state['state_dict'])
30
- data = torch.zeros((1, 3, img_size, img_size)) #b, c, h, w = 1, 3, 224, 224
31
  model.fc = nn.Identity()
32
  output = model(data)#b, c = 1, 512
33
  print(output.shape)
 
5
  from torch import nn
6
 
7
  img_size = 224
8
+ path = r'./CSAT_ImageNet.pth.tar' #or CSAT_RCKD.pth.tar <- for pathological image analysis
9
  model = CSAT(img_size=img_size)
10
  state = torch.load(path, map_location='cpu')
11
  model.load_state_dict(state)
 
14
  output = model(data)#b, c = 1, 176
15
  print(output.shape)
16
 
17
+ path = r'./ResNet18_RCKD.pth.tar'
18
  model = ResNet18()
19
  state = torch.load(path, map_location='cpu')
20
  model.load_state_dict(state)
 
23
  output = model(data)#b, c = 1, 512
24
  print(output.shape)
25
 
26
+ path = r'./CSAT_v2_ImageNet.pth.tar'
27
  model = CSATv2(img_size=img_size)
28
  state = torch.load(path, map_location='cpu')
29
  model.load_state_dict(state['state_dict'])
30
+ data = torch.zeros((1, 3, img_size, img_size)) #b, c, h, w = 1, 3, 512, 512
31
  model.fc = nn.Identity()
32
  output = model(data)#b, c = 1, 512
33
  print(output.shape)
model/__pycache__/CSAT.cpython-38.pyc DELETED
Binary file (17.3 kB)
 
model/__pycache__/CSATv2.cpython-38.pyc DELETED
Binary file (14.5 kB)
 
model/__pycache__/DCT.cpython-38.pyc DELETED
Binary file (12.7 kB)
 
model/__pycache__/ResNet18.cpython-38.pyc DELETED
Binary file (804 Bytes)
 
model/__pycache__/SPTCNN.cpython-38.pyc DELETED
Binary file (17.3 kB)