- 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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |