Skip to content

Commit

Permalink
Update dockerfile and visdom class
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrodiamel committed Feb 17, 2023
1 parent d5538e2 commit cfb757c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG UBUNTU_VERSION=18.04
ARG CUDA_VERSION=11.7.0
ARG CUDA_VERSION=11.6.0
ARG PYTORCH_CUDA=11.6
FROM nvidia/cuda:${CUDA_VERSION}-base-ubuntu${UBUNTU_VERSION}

ARG DEBIAN_FRONTEND=noninteractive
Expand All @@ -23,6 +24,7 @@ RUN apt-get update && \
libjpeg-dev \
libpng-dev \
byobu \
htop \
vim && \
# Remove the effect of `apt-get update`
rm -rf /var/lib/apt/lists/* && \
Expand All @@ -42,7 +44,7 @@ RUN curl -o miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-L
./miniconda.sh -b -p conda && \
rm miniconda.sh && \
conda/bin/conda install -y python=$PYTHON_VERSION jupyter jupyterlab && \
conda/bin/conda install -y pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia && \
conda/bin/conda install -y pytorch torchvision torchaudio pytorch-cuda=$PYTORCH_CUDA -c pytorch -c nvidia && \
conda/bin/conda clean -ya
ENV PATH $HOME/conda/bin:$PATH

Expand Down
10 changes: 5 additions & 5 deletions pytvision/graphic.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def __init__(self, env_name="main", server=None, port=None) -> None:
if server is None:
server = os.environ.get("VISDOM_SERVER_URL", "localhost")
if port is None:
port = int(os.environ.get("VISDOM_PORT", 8097))
port = int(os.environ.get("VISDOM_PORT", 6006))

self.viz = Visdom(server=server, port=port, use_incoming_socket=False)
self.env = env_name
Expand Down Expand Up @@ -102,9 +102,9 @@ def show(self, title, image):
image = cv2.resize(image, self.heatsize, interpolation=cv2.INTER_LINEAR)

if title not in self.hmaps:
self.hmaps[title] = self.vis.heatmap(image, env=self.env, opts=dict(title=title))
self.hmaps[title] = self.viz.heatmap(image, env=self.env, opts=dict(title=title))
else:
self.vis.heatmap(image, env=self.env, win=self.hmaps[title], opts=dict(title=title))
self.viz.heatmap(image, env=self.env, win=self.hmaps[title], opts=dict(title=title))


class ImageVisdom(VisdomLogger):
Expand All @@ -122,6 +122,6 @@ def show(self, title, image):
image = np.transpose(image, (2, 0, 1))

if title not in self.images:
self.images[title] = self.vis.image(image, env=self.env, opts=dict(title=title))
self.images[title] = self.viz.image(image, env=self.env, opts=dict(title=title))
else:
self.vis.image(image, env=self.env, win=self.images[title], opts=dict(title=title))
self.viz.image(image, env=self.env, win=self.images[title], opts=dict(title=title))
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ tqdm
scipy
visdom
scikit-image
sklearn
scikit-fmm
scikit-learn
opencv-python
scikit-fmm
opencv-python

0 comments on commit cfb757c

Please sign in to comment.