vobecant
commited on
Commit
·
b426e64
1
Parent(s):
318ffb5
Initial commit.
Browse files- .idea/workspace.xml +17 -2
- segmenter_model/factory.py +4 -2
.idea/workspace.xml
CHANGED
@@ -2,6 +2,7 @@
|
|
2 |
<project version="4">
|
3 |
<component name="ChangeListManager">
|
4 |
<list default="true" id="5dd22f22-8223-4d55-99f9-57d1e00622d7" name="Default Changelist" comment="Initial commit.">
|
|
|
5 |
<change beforePath="$PROJECT_DIR$/segmenter_model/factory.py" beforeDir="false" afterPath="$PROJECT_DIR$/segmenter_model/factory.py" afterDir="false" />
|
6 |
</list>
|
7 |
<option name="SHOW_DIALOG" value="false" />
|
@@ -50,7 +51,7 @@
|
|
50 |
<option name="number" value="Default" />
|
51 |
<option name="presentableId" value="Default" />
|
52 |
<updated>1647350746642</updated>
|
53 |
-
<workItem from="1647350750956" duration="
|
54 |
</task>
|
55 |
<task id="LOCAL-00001" summary="Initial commit.">
|
56 |
<created>1647352693910</created>
|
@@ -143,7 +144,21 @@
|
|
143 |
<option name="project" value="LOCAL" />
|
144 |
<updated>1647356326582</updated>
|
145 |
</task>
|
146 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
<servers />
|
148 |
</component>
|
149 |
<component name="TypeScriptGeneratedFilesManager">
|
|
|
2 |
<project version="4">
|
3 |
<component name="ChangeListManager">
|
4 |
<list default="true" id="5dd22f22-8223-4d55-99f9-57d1e00622d7" name="Default Changelist" comment="Initial commit.">
|
5 |
+
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
6 |
<change beforePath="$PROJECT_DIR$/segmenter_model/factory.py" beforeDir="false" afterPath="$PROJECT_DIR$/segmenter_model/factory.py" afterDir="false" />
|
7 |
</list>
|
8 |
<option name="SHOW_DIALOG" value="false" />
|
|
|
51 |
<option name="number" value="Default" />
|
52 |
<option name="presentableId" value="Default" />
|
53 |
<updated>1647350746642</updated>
|
54 |
+
<workItem from="1647350750956" duration="6226000" />
|
55 |
</task>
|
56 |
<task id="LOCAL-00001" summary="Initial commit.">
|
57 |
<created>1647352693910</created>
|
|
|
144 |
<option name="project" value="LOCAL" />
|
145 |
<updated>1647356326582</updated>
|
146 |
</task>
|
147 |
+
<task id="LOCAL-00014" summary="Initial commit.">
|
148 |
+
<created>1647356574037</created>
|
149 |
+
<option name="number" value="00014" />
|
150 |
+
<option name="presentableId" value="LOCAL-00014" />
|
151 |
+
<option name="project" value="LOCAL" />
|
152 |
+
<updated>1647356574037</updated>
|
153 |
+
</task>
|
154 |
+
<task id="LOCAL-00015" summary="Initial commit.">
|
155 |
+
<created>1647356671773</created>
|
156 |
+
<option name="number" value="00015" />
|
157 |
+
<option name="presentableId" value="LOCAL-00015" />
|
158 |
+
<option name="project" value="LOCAL" />
|
159 |
+
<updated>1647356671773</updated>
|
160 |
+
</task>
|
161 |
+
<option name="localTasksCounter" value="16" />
|
162 |
<servers />
|
163 |
</component>
|
164 |
<component name="TypeScriptGeneratedFilesManager">
|
segmenter_model/factory.py
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
import os
|
2 |
from pathlib import Path
|
3 |
|
4 |
-
import requests
|
5 |
import yaml
|
6 |
from timm.models.helpers import load_pretrained, load_custom_pretrained
|
7 |
from timm.models.registry import register_model
|
@@ -49,7 +48,10 @@ def create_vit(model_cfg):
|
|
49 |
# hard-coded for now, too lazy
|
50 |
pretrained_weights = 'dino_deitsmall16_pretrain.pth'
|
51 |
if not os.path.exists(pretrained_weights):
|
52 |
-
|
|
|
|
|
|
|
53 |
model.load_state_dict(torch.load(pretrained_weights), strict=True)
|
54 |
else:
|
55 |
model = torch.hub.load('facebookresearch/dino:main', backbone)
|
|
|
1 |
import os
|
2 |
from pathlib import Path
|
3 |
|
|
|
4 |
import yaml
|
5 |
from timm.models.helpers import load_pretrained, load_custom_pretrained
|
6 |
from timm.models.registry import register_model
|
|
|
48 |
# hard-coded for now, too lazy
|
49 |
pretrained_weights = 'dino_deitsmall16_pretrain.pth'
|
50 |
if not os.path.exists(pretrained_weights):
|
51 |
+
import urllib.request
|
52 |
+
urllib.request.urlretrieve(
|
53 |
+
"https://dl.fbaipublicfiles.com/dino/dino_deitsmall16_pretrain/dino_deitsmall16_pretrain.pth",
|
54 |
+
pretrained_weights)
|
55 |
model.load_state_dict(torch.load(pretrained_weights), strict=True)
|
56 |
else:
|
57 |
model = torch.hub.load('facebookresearch/dino:main', backbone)
|