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
6d55e14b
Commit
6d55e14b
authored
1 year ago
by
Alexandre Chapin
Browse files
Options
Downloads
Patches
Plain Diff
Fix tqdm import
parent
3a4fb34b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
osrt/layers.py
+1
-0
1 addition, 0 deletions
osrt/layers.py
osrt/model.py
+0
-3
0 additions, 3 deletions
osrt/model.py
train_sa.py
+1
-1
1 addition, 1 deletion
train_sa.py
with
2 additions
and
4 deletions
osrt/layers.py
+
1
−
0
View file @
6d55e14b
...
...
@@ -295,6 +295,7 @@ class SoftPositionEmbed(nn.Module):
def
forward
(
self
,
inputs
):
return
inputs
+
self
.
dense
(
torch
.
tensor
(
self
.
grid
).
cuda
()).
permute
(
0
,
3
,
1
,
2
)
# from [b, h, w, c] to [b, c, h, w]
### New transformer implementation of SlotAttention inspired from https://github.com/ThomasMrY/VCT/blob/master/models/visual_concept_tokenizor.py
class
TransformerSlotAttention
(
nn
.
Module
):
"""
...
...
This diff is collapsed.
Click to expand it.
osrt/model.py
+
0
−
3
View file @
6d55e14b
...
...
@@ -54,14 +54,11 @@ def spatial_broadcast(slots, resolution):
# `grid` has shape: [batch_size*num_slots, width, height, slot_size].
return
grid
# TODO : adapt this model
class
SlotAttentionAutoEncoder
(
nn
.
Module
):
"""
Slot Attention as introduced by Locatello et al. but with the AutoEncoder part to extract image embeddings.
Implementation inspired from official repo : https://github.com/google-research/google-research/blob/master/slot_attention/model.py
"""
def
__init__
(
self
,
resolution
,
num_slots
,
num_iterations
):
...
...
This diff is collapsed.
Click to expand it.
train_sa.py
+
1
−
1
View file @
6d55e14b
...
...
@@ -13,7 +13,7 @@ from osrt.utils.common import mse2psnr
from
torch.utils.data
import
DataLoader
import
torch.nn.functional
as
F
import
tqdm
from
tqdm
import
tqdm
def
train_step
(
batch
,
model
,
optimizer
,
device
):
"""
Perform a single training step.
"""
...
...
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