<jupyter_start><jupyter_text>Note that in order to run Py2.7 to run the pupil analysis code and new conda env must be made. To do this run the following code in cmd with anaconda installed:    conda create -n pupil27 python=2.7 ipykernel anacondaThis will install a new environment names pupil27 that runs on python2.7 and has all basic anaconda packages installed so that you can run a jupyter notebook for analysis.Check below that you have the correct python version installed. It should print     2.7.17<jupyter_code>from platform import python_version
print (python_version())
# OPTIONAL: Load the "autoreload" extension so that code can change
%load_ext autoreload

# OPTIONAL: always reload modules so that as you change code in src, it gets loaded
%autoreload 2

from src.fix.pupil_quant import pupil_quant_cmh as pq
vp = "data/raw/101619_V2.4/101619_V2.4_-400.avi"
vp1 = "data/raw/101619_V2.4/101619_V2.4_-527.avi"

vpb = "data/raw/121219_V26_39um_2x.avi"

pq(vpb)<jupyter_output>('Params are:', {'ratio_threshold': 2, 'perc_weight': 0.9, 'min_contour_len': 5, 'error_threshold': 1, 'gaussian_blur': 5, 'perc_low': 10, 'dr_threshold': 0.2, 'contrast_threshold': 0.2, 'speed_threshold': 0.2, 'relative_area_threshold': 0.01, 'margin': 0.02, 'perc_high': 90})
('Filename is:', '121219_V26_39um_2x')
('File path is:', 'data/raw/121219_V26_39um_2x.avi')
('Contrast (std)', 16.280489763011424)
Im at 1
Im at 2
Start Mouse Position: 257, 130
Im at 3
Im at 4
[[131 174]
 [258 310]]
Im at 5
[[131 174]
 [258 310]]
	frame (500/9000)
	frame (1000/9000)
	frame (1500/9000)
	frame (2000/9000)
	frame (2500/9000)
	frame (3000/9000)
	frame (3500/9000)
	frame (4000/9000)
	frame (4500/9000)
	frame (5000/9000)
	frame (5500/9000)
	frame (6000/9000)
	frame (6500/9000)
	frame (7000/9000)
	frame (7500/9000)
	frame (8000/9000)
	frame (8500/9000)
	frame (9000/9000)
('Reached end of videofile ', 'data/raw/121219_V26_39um_2x.avi')<jupyter_text>Note: Issue above seems to be from differences between OpenCV2, 3, and 4. See link:    https://stackoverflow.com/questions/20851365/opencv-contours-need-more-than-2-values-to-unpackModifying the code in PupilTracker.track() to expect 2 arguments<jupyter_code>vp = "data/raw/101619_V2.4/101619_V2.4_-400.avi"
vp1 = "data/raw/101619_V2.4/101619_V2.4_-527.avi"

pq(vp1)
pq(vp)<jupyter_output>('Params are:', {'ratio_threshold': 2, 'perc_weight': 0.9, 'min_contour_len': 5, 'error_threshold': 1, 'gaussian_blur': 5, 'perc_low': 10, 'dr_threshold': 0.2, 'contrast_threshold': 0.2, 'speed_threshold': 0.2, 'relative_area_threshold': 0.01, 'margin': 0.02, 'perc_high': 90})
('Filename is:', '101619_V2.4_-400')
('File path is:', 'data/raw/101619_V2.4/101619_V2.4_-400.avi')
('Contrast (std)', 19.298452237599864)
Im at 1
Im at 2
Start Mouse Position: 274, 142
Im at 3
Im at 4
[[143 216]
 [275 366]]
Im at 5
Start Mouse Position: 345, 146
Im at 3
Im at 4
[[147 212]
 [279 346]]
Im at 5
Start Mouse Position: 279, 149
Im at 3
Im at 4
[[150 209]
 [280 339]]
Im at 5
Made it past grab
[[150 209]
 [280 339]]
	frame (500/9000)
	frame (1000/9000)
	frame (1500/9000)
	frame (2000/9000)
	frame (2500/9000)
	frame (3000/9000)
	frame (3500/9000)
	frame (4000/9000)
	frame (4500/9000)
	frame (5000/9000)
	frame (5500/9000)
	frame (6000/9000)
	frame (6500/9000)
	frame (7000/9000)
	frame (7500/9000)
	frame ([...]
{'fraction_non_alphanumeric': 0.13701923076923078, 'fraction_numerical': 0.19020432692307693, 'mean_word_length': 4.739655172413793, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '663710', 'license': 'MIT', 'n_tokens_mistral': 1754, 'n_tokens_neox': 1342, 'n_words': 393, 'path': 'notebooks/20190519_pupil_start.ipynb', 'repo_name': 'ixianid/pupilometry', 'size': '3328'}