Update app.py
Browse files
app.py
CHANGED
|
@@ -514,9 +514,71 @@ text = """
|
|
| 514 |
</div>
|
| 515 |
"""
|
| 516 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 517 |
pipe, image_predictor, video_predictor = get_pipe_image_and_video_predictor()
|
| 518 |
|
| 519 |
-
with gr.Blocks() as demo:
|
| 520 |
video_state = gr.State(
|
| 521 |
{
|
| 522 |
"origin_images": None,
|
|
@@ -568,63 +630,6 @@ with gr.Blocks() as demo:
|
|
| 568 |
elem_id="my-video",
|
| 569 |
)
|
| 570 |
|
| 571 |
-
demo.css = """
|
| 572 |
-
#my-btn {
|
| 573 |
-
width: 60% !important;
|
| 574 |
-
margin: 0 auto;
|
| 575 |
-
}
|
| 576 |
-
#my-video1 {
|
| 577 |
-
width: 60% !important;
|
| 578 |
-
height: 35% !important;
|
| 579 |
-
margin: 0 auto;
|
| 580 |
-
}
|
| 581 |
-
#my-video {
|
| 582 |
-
width: 60% !important;
|
| 583 |
-
height: 35% !important;
|
| 584 |
-
margin: 0 auto;
|
| 585 |
-
}
|
| 586 |
-
#my-md {
|
| 587 |
-
margin: 0 auto;
|
| 588 |
-
}
|
| 589 |
-
#my-btn2 {
|
| 590 |
-
width: 60% !important;
|
| 591 |
-
margin: 0 auto;
|
| 592 |
-
}
|
| 593 |
-
#my-btn2 button {
|
| 594 |
-
width: 120px !important;
|
| 595 |
-
max-width: 120px !important;
|
| 596 |
-
min-width: 120px !important;
|
| 597 |
-
height: 70px !important;
|
| 598 |
-
max-height: 70px !important;
|
| 599 |
-
min-height: 70px !important;
|
| 600 |
-
margin: 8px !important;
|
| 601 |
-
border-radius: 8px !important;
|
| 602 |
-
overflow: hidden !important;
|
| 603 |
-
white-space: normal !important;
|
| 604 |
-
}
|
| 605 |
-
#my-btn3 {
|
| 606 |
-
width: 60% !important;
|
| 607 |
-
margin: 0 auto;
|
| 608 |
-
}
|
| 609 |
-
#ref_title {
|
| 610 |
-
text-align: center;
|
| 611 |
-
}
|
| 612 |
-
#ref-image {
|
| 613 |
-
width: 60% !important;
|
| 614 |
-
height: 35% !important;
|
| 615 |
-
margin: 0 auto;
|
| 616 |
-
}
|
| 617 |
-
#ref-mask {
|
| 618 |
-
width: 60% !important;
|
| 619 |
-
height: 35% !important;
|
| 620 |
-
margin: 0 auto;
|
| 621 |
-
}
|
| 622 |
-
#mesh-row {
|
| 623 |
-
width: 60% !important;
|
| 624 |
-
margin: 0 auto;
|
| 625 |
-
}
|
| 626 |
-
"""
|
| 627 |
-
|
| 628 |
with gr.Row(elem_id="my-btn"):
|
| 629 |
point_prompt = gr.Radio(
|
| 630 |
["Positive", "Negative"], label="Click Type", value="Positive"
|
|
@@ -778,3 +783,4 @@ with gr.Blocks() as demo:
|
|
| 778 |
|
| 779 |
demo.launch()
|
| 780 |
|
|
|
|
|
|
| 514 |
</div>
|
| 515 |
"""
|
| 516 |
|
| 517 |
+
css = """
|
| 518 |
+
.gradio-container {
|
| 519 |
+
max-width: 60% !important;
|
| 520 |
+
margin: 0 auto !important;
|
| 521 |
+
}
|
| 522 |
+
|
| 523 |
+
#my-btn {
|
| 524 |
+
width: 60% !important;
|
| 525 |
+
margin: 0 auto;
|
| 526 |
+
}
|
| 527 |
+
#my-video1 {
|
| 528 |
+
width: 60% !important;
|
| 529 |
+
height: 35% !important;
|
| 530 |
+
margin: 0 auto;
|
| 531 |
+
}
|
| 532 |
+
#my-video {
|
| 533 |
+
width: 60% !important;
|
| 534 |
+
height: 35% !important;
|
| 535 |
+
margin: 0 auto;
|
| 536 |
+
}
|
| 537 |
+
#my-md {
|
| 538 |
+
margin: 0 auto;
|
| 539 |
+
}
|
| 540 |
+
#my-btn2 {
|
| 541 |
+
width: 60% !important;
|
| 542 |
+
margin: 0 auto;
|
| 543 |
+
}
|
| 544 |
+
#my-btn2 button {
|
| 545 |
+
width: 120px !important;
|
| 546 |
+
max-width: 120px !important;
|
| 547 |
+
min-width: 120px !important;
|
| 548 |
+
height: 70px !important;
|
| 549 |
+
max-height: 70px !important;
|
| 550 |
+
min-height: 70px !important;
|
| 551 |
+
margin: 8px !important;
|
| 552 |
+
border-radius: 8px !important;
|
| 553 |
+
overflow: hidden !important;
|
| 554 |
+
white-space: normal !important;
|
| 555 |
+
}
|
| 556 |
+
#my-btn3 {
|
| 557 |
+
width: 60% !important;
|
| 558 |
+
margin: 0 auto;
|
| 559 |
+
}
|
| 560 |
+
#ref_title {
|
| 561 |
+
text-align: center;
|
| 562 |
+
}
|
| 563 |
+
#ref-image {
|
| 564 |
+
width: 60% !important;
|
| 565 |
+
height: 35% !important;
|
| 566 |
+
margin: 0 auto;
|
| 567 |
+
}
|
| 568 |
+
#ref-mask {
|
| 569 |
+
width: 60% !important;
|
| 570 |
+
height: 35% !important;
|
| 571 |
+
margin: 0 auto;
|
| 572 |
+
}
|
| 573 |
+
#mesh-row {
|
| 574 |
+
width: 60% !important;
|
| 575 |
+
margin: 0 auto;
|
| 576 |
+
}
|
| 577 |
+
"""
|
| 578 |
+
|
| 579 |
pipe, image_predictor, video_predictor = get_pipe_image_and_video_predictor()
|
| 580 |
|
| 581 |
+
with gr.Blocks(css=css) as demo:
|
| 582 |
video_state = gr.State(
|
| 583 |
{
|
| 584 |
"origin_images": None,
|
|
|
|
| 630 |
elem_id="my-video",
|
| 631 |
)
|
| 632 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 633 |
with gr.Row(elem_id="my-btn"):
|
| 634 |
point_prompt = gr.Radio(
|
| 635 |
["Positive", "Negative"], label="Click Type", value="Positive"
|
|
|
|
| 783 |
|
| 784 |
demo.launch()
|
| 785 |
|
| 786 |
+
|