Skip to content

Commit

Permalink
Add new plugin integration
Browse files Browse the repository at this point in the history
  • Loading branch information
LashaO committed Apr 21, 2023
1 parent 30620d4 commit 83ddb93
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 2 deletions.
1 change: 1 addition & 0 deletions _dev/super_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
('WildMeOrg/wbia-plugin-pie', 'wbia-plugin-pie', 'develop'),
('WildMeOrg/wbia-plugin-pie-v2', 'wbia-plugin-pie-v2', 'develop'),
('WildMeOrg/wbia-plugin-lca', 'wbia-plugin-lca', 'develop'),
('WildMeOrg/wbia-plugin-tbd', 'wbia-plugin-tbd', 'develop'),
# ('WildMeOrg/wbia-plugin-2d-orientation', 'wbia-plugin-2d-orientation', 'develop'),
]

Expand Down
10 changes: 9 additions & 1 deletion devops/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,14 @@ RUN set -ex \
&& /virtualenv/env3/bin/pip uninstall -y \
nvidia_cublas_cu11

# RUN set -ex \
# && /virtualenv/env3/bin/pip install \
# timm==0.6.12

# RUN set -ex \
# && /virtualenv/env3/bin/pip install \
# albumentations==1.3.0

# Run smoke tests
RUN set -ex \
&& mkdir -p /data \
Expand Down Expand Up @@ -173,4 +181,4 @@ FROM org.wildme.wbia.install as org.wildme.wbia.depricated

COPY ./_config/deprecated.sh /bin/deprecated

RUN if [ "$(uname -m)" != "aarch64" ] ; then deprecated ; fi
#RUN if [ "$(uname -m)" != "aarch64" ] ; then deprecated ; fi
4 changes: 3 additions & 1 deletion devops/provision/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ RUN set -ex \
&& git clone https://github.com/WildMeOrg/wbia-plugin-flukematch.git \
&& git clone https://github.com/WildMeOrg/wbia-plugin-finfindr.git \
&& git clone https://github.com/WildMeOrg/wbia-plugin-deepsense.git \
&& git clone https://github.com/WildMeOrg/wbia-plugin-pie-v2.git
&& git clone https://github.com/WildMeOrg/wbia-plugin-pie-v2.git \
&& git clone https://github.com/WildMeOrg/wbia-plugin-tbd.git


RUN set -ex \
&& cd /wbia \
Expand Down
2 changes: 2 additions & 0 deletions requirements/runtime.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ sqlalchemy==1.4.14
SQLAlchemy-Utils==0.38.3
tensorboard_logger==0.1.0
Theano==1.0.5
timm==0.6.12
albumentations==1.3.0
torch==1.13.1
torchvision==0.14.1
torchaudio==0.13.1
Expand Down
30 changes: 30 additions & 0 deletions wbia/algo/graph/mixin_matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,36 @@ def _make_rankings(
edges = set(edges)
return edges
# </HACK>
# <HACK FOR TBD>
if cfgdict.get('pipeline_root', None) in ['Tbd']:
from wbia_tbd._plugin import distance_to_score

globals().update(locals())

edges = []

for qaid in tqdm.tqdm(qaids):
daids_ = list(set(daids) - {qaid})
tbd_annot_distances = ibs.tbd_predict_light_distance(
qaid,
daids_,
)
score_list = [
distance_to_score(tbd_annot_distance, norm=500.0)
for tbd_annot_distance in tbd_annot_distances
]
values = sorted(zip(score_list, daids_))[::-1]
keep = values[:ranks_top]
daid_list = ut.take_column(keep, 1)
for daid in daid_list:
u, v = (qaid, daid)
if v < u:
u, v = v, u
edges.append((u, v))

edges = set(edges)
return edges
# </HACK>

if batch_size is not None:
qaids_chunks = list(ut.ichunks(qaids, batch_size))
Expand Down
5 changes: 5 additions & 0 deletions wbia/control/IBEISControl.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@
(('--no-pie-v2', '--nopiev2'), 'wbia_pie_v2._plugin'),
]

if ut.get_argflag('--tbd'):
AUTOLOAD_PLUGIN_MODNAMES += [
(('--no-tbd', '--notbd'), 'wbia_tbd._plugin'),
]


if ut.get_argflag('--blend'):
AUTOLOAD_PLUGIN_MODNAMES += [
Expand Down
2 changes: 2 additions & 0 deletions wbia/scripts/specialdraw.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ def double_depcache_graph():
'Deepsense': 'Deepsense Distance',
'Pie': 'Pie Distance',
'PieTwo': 'Pie v2 Distance',
'Tbd': 'Tbd Distance',
'Finfindr': 'Finfindr Distance',
'Kaggle7': 'Kaggle7 Distance',
'KaggleSeven': 'Kaggle7 Distance',
Expand Down Expand Up @@ -328,6 +329,7 @@ def double_depcache_graph():
'Deepsense': 'deepsense_distance',
'Pie': 'pie_distance',
'PieTwo': 'pie_v2_distance',
'Tbd': 'tbd_distance',
'Finfindr': 'finfindr_distance',
'Kaggle7': 'kaggle7_distance',
'KaggleSeven': 'kaggle7_distance',
Expand Down
2 changes: 2 additions & 0 deletions wbia/viz/viz_matches.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def get_query_annot_pair_info(
'kaggleseven',
'pie',
'pietwo',
'tbd'
]
) and getattr(qreq_, '_isnewreq', None):
if (
Expand Down Expand Up @@ -99,6 +100,7 @@ def get_data_annot_pair_info(
'kaggleseven',
'pie',
'pietwo',
'tbd'
]
) and getattr(qreq_, '_isnewreq', None):
if (
Expand Down
3 changes: 3 additions & 0 deletions wbia/web/apis_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ def review_graph_match_html(
'kaggleseven',
'pie',
'pietwo',
'tbd'
):
cls = chip_match.AnnotMatch # ibs.depc_annot.requestclass_dict['BC_DTW']
else:
Expand Down Expand Up @@ -586,6 +587,8 @@ def review_query_chips_test(**kwargs):
query_config_dict = {'pipeline_root': 'Pie'}
elif 'use_pie_v2' in request.args:
query_config_dict = {'pipeline_root': 'PieTwo'}
elif 'use_tbd' in request.args:
query_config_dict = {'pipeline_root': 'Tbd'}
else:
query_config_dict = {}
result_dict = ibs.query_chips_test(query_config_dict=query_config_dict)
Expand Down

0 comments on commit 83ddb93

Please sign in to comment.