Skip to content

Commit

Permalink
updated ingredient of notebook setup to install libraries based on wh…
Browse files Browse the repository at this point in the history
…ether it's running locally or in colab
  • Loading branch information
brunomsaraiva committed Oct 17, 2023
1 parent 4ce3cc2 commit 88f0a10
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/notebookchef/pantry/notebook_setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
#@title Install NanoPyx, import necessary libraries and connect to Google Drive
!pip install -q "nanopyx[jupyter]"
import sys
IN_COLAB = 'google.colab' in sys.modules
if IN_COLAB:
!pip install -q "nanopyx[colab]"
from google.colab import output
output.enable_custom_widget_manager()
from google.colab import drive
drive.mount('/content/drive')
else:
!pip instal -q "nanopyx[jupyter]"

import io
import os
import sys
import cv2 as cv
import skimage
import nanopyx
Expand All @@ -19,14 +28,6 @@
from nanopyx.core.utils.find_files import find_files
from nanopyx.data.download import ExampleDataManager

IN_COLAB = 'google.colab' in sys.modules
if IN_COLAB:
!pip install -q ipycanvas==0.11.0
from google.colab import output
output.enable_custom_widget_manager()
from google.colab import drive
drive.mount('/content/drive')

cwd = os.getcwd()
image_folder = "datasets"
image_files = []
Expand Down

0 comments on commit 88f0a10

Please sign in to comment.