Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
almazgimaev committed Dec 18, 2024
1 parent 0a5f9ac commit b4bb9b9
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,15 @@ def toggle_ann():
@bokeh.value_changed
def on_click(selected_idxs):
global global_idxs_mapping, all_info_list, project_meta, is_marked, tag_meta
info = all_info_list[selected_idxs]
if tag_meta is not None:
tag = read_tag(info["image_id"], info["object_id"])
is_marked = bool(tag)
update_marked()
show_image(info, project_meta)
if btn_mark.is_hidden():
btn_mark.show()
if len(selected_idxs) == 1:
info = all_info_list[selected_idxs[0]]
if tag_meta is not None:
tag = read_tag(info["image_id"], info["object_id"])
is_marked = bool(tag)
update_marked()
show_image(info, project_meta)
if btn_mark.is_hidden():
btn_mark.show()


def update_marked():
Expand Down Expand Up @@ -382,17 +383,17 @@ def run():
# 6. Show chart
obj_classes = list(set(all_info["object_cls"]))
print(f"n_classes = {len(obj_classes)}")
series, colors, global_idxs_mapping = run_utils.make_series(projections, all_info_list, project_meta)
series, pre_colors, global_idxs_mapping = run_utils.make_series(projections, all_info_list, project_meta)

x_coordinates, y_coordinates, colors = [], [], []
for s, color in zip(series, colors):
for s, color in zip(series, pre_colors):
x_coordinates.extend([i["x"] for i in s["data"]])
y_coordinates.extend([i["y"] for i in s["data"]])
colors.extend([color] * len(s["data"]))

plot = Bokeh.Circle(x_coordinates, y_coordinates, radii=0.05, colors=colors)
bokeh.add_plots([plot])
bokeh_iframe.set(bokeh.get_html_route_with_timestamp(), height="600px", width="100%")
bokeh_iframe.set(bokeh.get_html_route_with_timestamp(), height="650px", width="100%")
card_embeddings_chart.show()
update_table()
info_run.description += "Done!<br>"
Expand Down

0 comments on commit b4bb9b9

Please sign in to comment.