mirror of
https://github.com/RootKit-Org/AI-Aimbot.git
synced 2025-06-21 02:41:01 +08:00
bugfix: fix issue 'cannot import name is_notebook' (#41)
This commit is contained in:
parent
65cb7a2111
commit
64a3927762
@ -27,6 +27,7 @@ from typing import Optional
|
||||
from zipfile import ZipFile
|
||||
|
||||
import cv2
|
||||
import IPython
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
import pkg_resources as pkg
|
||||
@ -137,6 +138,11 @@ def user_config_dir(dir='Ultralytics', env_var='YOLOV5_CONFIG_DIR'):
|
||||
path.mkdir(exist_ok=True) # make if required
|
||||
return path
|
||||
|
||||
def is_notebook():
|
||||
# Is environment a Jupyter notebook? Verified on Colab, Jupyterlab, Kaggle, Paperspace
|
||||
ipython_type = str(type(IPython.get_ipython()))
|
||||
return 'colab' in ipython_type or 'zmqshell' in ipython_type
|
||||
|
||||
|
||||
CONFIG_DIR = user_config_dir() # Ultralytics settings dir
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user