Skip to content

Instantly share code, notes, and snippets.

View FrancescoSaverioZuppichini's full-sized avatar
🧸
Focusing

Francesco Saverio Zuppichini FrancescoSaverioZuppichini

🧸
Focusing
  • roboflow
  • Lugano, Switzerland
View GitHub Profile
@FrancescoSaverioZuppichini
FrancescoSaverioZuppichini / git-ssh-error-fix.sh
Created June 12, 2023 14:24 — forked from Tamal/git-ssh-error-fix.sh
Solution for 'ssh: connect to host github.com port 22: Connection timed out' error
$ git clone git@github.com:xxxxx/xxxx.git my-awesome-proj
Cloning into 'my-awesome-proj'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
$ # This should also timeout
$ ssh -T git@github.com
ssh: connect to host github.com port 22: Connection timed out
$ # but this might work
%%timeit
torch_nms(bboxes + labels[..., None], scores, .45)
%%timeit
nms(bboxes + labels[..., None], scores, .45)
from torchvision.ops.boxes import nms as torch_nms
nms_indices = torch_nms(bboxes + labels[..., None], scores, .45)
plot_bboxes(img,
bboxes[nms_indices],
colors=["yellow" if el.item() == 0 else "blue" for el in labels[nms_indices]],
labels=["head" if el.item() == 0 else "mic" for el in labels[nms_indices]]
)
from ipywidgets import interact
def _interact(threshold: float):
print(threshold)
nms_indices = nms(bboxes + labels[..., None], scores, threshold)
plot_bboxes(img,
bboxes[nms_indices],
colors=["yellow" if el.item() == 0 else "blue" for el in labels[nms_indices]],
labels=["head" if el.item() == 0 else "mic" for el in labels[nms_indices]]
)
!jupyter nbextension enable --py widgetsnbextension --sys-prefix
nms_indices = nms(bboxes + labels[..., None], scores, .45)
plot_bboxes(img,
bboxes[nms_indices],
colors=["yellow" if el.item() == 0 else "blue" for el in labels[nms_indices]],
labels=["head" if el.item() == 0 else "mic" for el in labels[nms_indices]]
)
nms_indices = nms(bboxes, scores, .45)
plot_bboxes(img,
bboxes[nms_indices],
colors=["yellow" if el.item() == 0 else "blue" for el in labels[nms_indices]],
labels=["head" if el.item() == 0 else "mic" for el in labels[nms_indices]]
)
overlapped = torch.nonzero(iou > iou_threshold)