DawnC commited on
Commit
b7e4542
1 Parent(s): f810e7e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -1
app.py CHANGED
@@ -480,7 +480,7 @@ async def predict(image):
480
  for j, (breed, prob) in enumerate(zip(topk_breeds, relative_probs)):
481
  description = get_dog_description(breed)
482
  dogs_info += f'''
483
- <div class="breed-option">
484
  <div class="breed-header">
485
  <span class="option-number">Option {j+1}</span>
486
  <span class="breed-name">{breed}</span>
@@ -850,6 +850,27 @@ async def predict(image):
850
  border-style: solid;
851
  border-color: rgba(44, 62, 80, 0.95) transparent transparent transparent;
852
  }}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
853
  </style>
854
  {dogs_info}
855
  """
 
480
  for j, (breed, prob) in enumerate(zip(topk_breeds, relative_probs)):
481
  description = get_dog_description(breed)
482
  dogs_info += f'''
483
+ <div class="breed-option uncertainty-mode"> # 添加 uncertainty-mode 類
484
  <div class="breed-header">
485
  <span class="option-number">Option {j+1}</span>
486
  <span class="breed-name">{breed}</span>
 
850
  border-style: solid;
851
  border-color: rgba(44, 62, 80, 0.95) transparent transparent transparent;
852
  }}
853
+
854
+ .uncertainty-mode .tooltip .tooltip-text {{
855
+ position: absolute;
856
+ left: 100%;
857
+ bottom: auto;
858
+ top: 50%;
859
+ transform: translateY(-50%);
860
+ margin-left: 10px;
861
+ z-index: 1000; /* 確保提示框在最上層 */
862
+ }}
863
+
864
+ .uncertainty-mode .tooltip .tooltip-text::after {{
865
+ content: "";
866
+ position: absolute;
867
+ top: 50%;
868
+ right: 100%;
869
+ transform: translateY(-50%);
870
+ border-width: 5px;
871
+ border-style: solid;
872
+ border-color: transparent rgba(44, 62, 80, 0.95) transparent transparent;
873
+ }}
874
  </style>
875
  {dogs_info}
876
  """