Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Segment-Object-Centric
Manage
Activity
Members
Labels
Plan
Issues
3
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexandre Chapin
Segment-Object-Centric
Commits
35bb0ae0
Commit
35bb0ae0
authored
2 years ago
by
Alexandre Chapin
Browse files
Options
Downloads
Patches
Plain Diff
Change input image shape
parent
8dd11727
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
automatic_mask_train.py
+1
-2
1 addition, 2 deletions
automatic_mask_train.py
osrt/encoder.py
+1
-1
1 addition, 1 deletion
osrt/encoder.py
osrt/trainer.py
+1
-0
1 addition, 0 deletions
osrt/trainer.py
requirements.txt
+1
-0
1 addition, 0 deletions
requirements.txt
train.py
+2
-1
2 additions, 1 deletion
train.py
with
6 additions
and
4 deletions
automatic_mask_train.py
+
1
−
2
View file @
35bb0ae0
...
...
@@ -121,5 +121,4 @@ if __name__ == '__main__':
show_anns
(
masks
[
0
][
0
])
# show masks
show_points
(
new_points
,
plt
.
gca
())
# show points
plt
.
axis
(
'
off
'
)
plt
.
show
()
plt
.
show
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
osrt/encoder.py
+
1
−
1
View file @
35bb0ae0
...
...
@@ -112,7 +112,7 @@ class OSRTEncoder(nn.Module):
class
FeatureMasking
(
nn
.
Module
):
def
__init__
(
self
,
points_per_side
=
8
,
points_per_side
=
12
,
box_nms_thresh
=
0.7
,
stability_score_thresh
=
0.9
,
pred_iou_thresh
=
0.88
,
...
...
This diff is collapsed.
Click to expand it.
osrt/trainer.py
+
1
−
0
View file @
35bb0ae0
...
...
@@ -73,6 +73,7 @@ class SRTTrainer:
input_rays
=
data
.
get
(
'
input_rays
'
).
to
(
device
)
target_pixels
=
data
.
get
(
'
target_pixels
'
).
to
(
device
)
input_images
=
input_images
.
permute
(
0
,
2
,
3
,
1
).
unsqueeze
(
1
)
with
torch
.
cuda
.
amp
.
autocast
():
z
=
self
.
model
.
encoder
(
input_images
,
input_camera_pos
,
input_rays
)
...
...
This diff is collapsed.
Click to expand it.
requirements.txt
+
1
−
0
View file @
35bb0ae0
...
...
@@ -7,3 +7,4 @@ imageio
matplotlib
tqdm
opencv-python
bitsandbytes
This diff is collapsed.
Click to expand it.
train.py
+
2
−
1
View file @
35bb0ae0
...
...
@@ -2,6 +2,7 @@ import torch
import
torch.optim
as
optim
from
torch.nn.parallel
import
DistributedDataParallel
import
numpy
as
np
import
bitsandbytes
as
bnb
import
os
import
argparse
...
...
@@ -146,7 +147,7 @@ if __name__ == '__main__':
# Intialize training
params
=
[
p
for
p
in
model
.
parameters
()
if
p
.
requires_grad
]
# only keep trainable parameters
optimizer
=
optim
.
Adam
(
params
,
lr
=
lr_scheduler
.
get_cur_lr
(
0
))
optimizer
=
bnb
.
optim
.
Adam8bit
(
params
,
lr
=
lr_scheduler
.
get_cur_lr
(
0
))
# Switched from :
optim.Adam(params, lr=lr_scheduler.get_cur_lr(0))
trainer
=
SRTTrainer
(
model
,
optimizer
,
cfg
,
device
,
out_dir
,
train_dataset
.
render_kwargs
)
checkpoint
=
Checkpoint
(
out_dir
,
device
=
device
,
encoder
=
encoder_module
,
decoder
=
decoder_module
,
optimizer
=
optimizer
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment