Skip to content

Instantly share code, notes, and snippets.

@Nico769
Nico769 / bg_subtr.py
Last active October 8, 2022 15:40
My implementation of Simple Frame Differencing, Naive Mean Background Model and EigenBackground Model for the task of background substraction in CV.
import numpy as np
import cv2 as cv
from sklearn.decomposition import PCA
# Instead of using opencv, we can use numpy
# def global_grayscale_threshold(input_image, threshold):
# return np.where(input_image > threshold, 255, 0).astype(np.uint8)
def simple_frame_differencing(curr_frame, bg_frame, threshold):
@Nico769
Nico769 / JupyterDocker.md
Created June 30, 2020 09:12
Running Jupyter notebooks with Docker-compose in PyCharm 2020.1 Professional Edition.
  • Create a Python project with default Venv in the same folder where Dockerfile and docker-compose.yml are located
  • Go to Settings -> Build, Execution, Deployment -> Docker and create a new Docker server. Use unix socket. "Successfully connected" should appear.
  • Configure Docker Compose as a remote Pycharm interpreter as per documentation.
  • Configure the Jupyter Server as per documentation, DO NOT use Managed Server option.
  • In the Project panel, right click on docker-compose.yml and run it.
  • Manually connect to Docker in the Services panel.
  • Run the Jupyter Notebook cells.