Skip to content

Commit

Permalink
Merge pull request #1 from Gorbush/Year-of-face
Browse files Browse the repository at this point in the history
Year of face
  • Loading branch information
Gorbush committed Jul 20, 2023
2 parents 3fd0918 + 7dc0d45 commit 84a1eed
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 3 deletions.
29 changes: 29 additions & 0 deletions backend/migrations/versions/192e728d2c5d.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""empty message
Revision ID: 192e728d2c5d
Revises: b0ffd37de12c
Create Date: 2023-07-17 18:35:33.808498
"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '192e728d2c5d'
down_revision = 'b0ffd37de12c'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('faces', sa.Column('asset_stamp', sa.DateTime(), nullable=True))
op.execute("update faces f set asset_stamp = (select created from assets a where a.id = f.asset_id) where asset_id is not null")
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('faces', 'asset_stamp')
# ### end Alembic commands ###
1 change: 1 addition & 0 deletions backend/timeline/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class Face(db.Model, SerializerMixin):

person_id = db.Column(db.Integer, db.ForeignKey('persons.id'))
asset_id = db.Column(db.Integer, db.ForeignKey('assets.id'))
asset_stamp = db.Column(db.DateTime)
encoding = db.Column(NumpyType)
confidence_level = db.Column(db.Integer, index=True)
already_clustered = db.Column(db.Boolean)
Expand Down
2 changes: 2 additions & 0 deletions backend/timeline/tasks/face_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def find_faces2(asset_id, call_match_tasks = True):
num_faces += 1
face = Face()
face.created = datetime.today()
face.asset_stamp = asset.created
face.ignore = False
face.already_clustered = False

Expand Down Expand Up @@ -271,6 +272,7 @@ def find_faces(asset_id, call_match_tasks):
num_faces += 1
face = Face()
face.created = datetime.today()
face.asset_stamp = asset.created
face.ignore = False
face.already_clustered = False
x, y, w, h = fbox['box']
Expand Down
13 changes: 10 additions & 3 deletions frontend/src/components/FaceView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@
class="fill-height ma-0"
align="center"
justify="center">
<v-progress-circular color="primary" indeterminate></v-progress-circular>
</v-row>
</template>
<v-progress-circular color="primary" indeterminate></v-progress-circular>
</v-row>
</template>
<v-container fluid style="background-color: transparent; padding: 3px; text-shadow: 1px 1px #D0D0D0; float:right; text-align: center; vertical-align: bottom; bottom: 0px;position: absolute;">
{{assetStamp}}
</v-container>
</v-img>
<face-name-selector :loaded="loaded" :closestPerson="closestPerson" @update="update" :face="face">Whos is this</face-name-selector>
<!--
Expand Down Expand Up @@ -74,6 +77,10 @@
distance() {
return this.element ? this.element.distance : null;
},
assetStamp() {
return (this.element && this.element.face && this.element.face.asset_stamp) ? this.element.face.asset_stamp.split(" ")[0] : "";
}
},
Expand Down

0 comments on commit 84a1eed

Please sign in to comment.