-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path6cd5ad04ca7a_densecaptioning.py
44 lines (33 loc) · 1.09 KB
/
6cd5ad04ca7a_densecaptioning.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""DenseCaptioning
Revision ID: 6cd5ad04ca7a
Revises: bcdeb6b47060
Create Date: 2022-03-09 12:07:45.244683
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '6cd5ad04ca7a'
down_revision = 'bcdeb6b47060'
branch_labels = None
depends_on = None
def upgrade():
op.create_table(
"denseCaptionParent",
sa.Column("id", sa.Integer, primary_key=True, index=True),
sa.Column("imageName", sa.String, unique=True, index=True),
)
op.create_table(
"denseCaptionChild",
sa.Column("id", sa.Integer, primary_key=True, index=True),
sa.Column("caption", sa.String, index=True),
sa.Column("score", sa.Float),
sa.Column("bounding_x", sa.Float),
sa.Column("bounding_y", sa.Float),
sa.Column("bounding_w", sa.Float),
sa.Column("bounding_h", sa.Float),
sa.Column("parent_id", sa.Integer),
sa.ForeignKeyConstraint(('parent_id',), ['denseCaptionParent.id'], ),
)
def downgrade():
op.drop_table("denseCaptionParent")
op.drop_table("denseCaptionChild")