Skip to content

Commit

Permalink
Start explain installation
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeySrus committed May 28, 2022
1 parent 36ede91 commit b3ffaf9
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
# nenets_walruses
RostovNats realization for hacks-ai hackathon
# ИИ на страже популяции ненецких моржей
Реализация подготовлена командой RostovNats

## Установка

### Через готовый образ Docker
Если не установлен Docker с поддержкой CUDA установите его с помощью следующей команды:
```shell
sh installation/install_cuda_docker.sh
```

### Вручную

10 changes: 5 additions & 5 deletions inference_utils/tiled_segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

WINDOW_STRIDE = 3/4
POLYGONS_MATCHING_THRESHOLD = 0.2
FILTER_FALSE_DETECTIONS_THRESHOLD = 0.15
FILTER_FALSE_DETECTIONS_THRESHOLD = 0.2
POINTS_MATCHING_THRESHOLD = 0.3
BIG_FILTER = 5
BIG_FILTER = 3.5


def compute_poly_incircle_center(_poly: Polygon) -> Tuple[int, int]:
Expand Down Expand Up @@ -222,7 +222,6 @@ def __init__(self,

for t_line in tqdm(self.segments):
for t in t_line:
# self.detections += t.detections
merge_carriers(self, t)

self.filter_noisy_points()
Expand All @@ -244,10 +243,11 @@ def average_polygons_area(self) -> float:

def filter_noisy_points(self):
avg_area = self.average_polygons_area()
print(FILTER_FALSE_DETECTIONS_THRESHOLD)
self.detections = [
d
for d in self.detections
if d.poly.area - avg_area * FILTER_FALSE_DETECTIONS_THRESHOLD > -1E-5 and isinstance(d.poly, Polygon) and d.poly.area < avg_area * BIG_FILTER
if (d.poly.area - avg_area * FILTER_FALSE_DETECTIONS_THRESHOLD > 1E-5) and isinstance(d.poly, Polygon) and (d.poly.area < avg_area * BIG_FILTER)
]

def filter_outlier_points(self):
Expand All @@ -257,7 +257,7 @@ def filter_outlier_points(self):
# max_pwd = pwd.max()
max_pwd = (self.hole_image.shape[1] + self.hole_image.shape[0]) / 2

db = DBSCAN(eps=max_pwd / 5, min_samples=10, n_jobs=4).fit(_X)
db = DBSCAN(eps=max_pwd / 6, min_samples=10, n_jobs=4).fit(_X)
labels = db.labels_

self.detections = [
Expand Down
17 changes: 17 additions & 0 deletions installation/install_cuda_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y curl
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install -y docker-ce

curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update
sudo apt-get install -y nvidia-docker2
sudo pkill -SIGHUP dockerd

0 comments on commit b3ffaf9

Please sign in to comment.