<commit_before>#!/usr/bin/env python

import kinect_lib.freenect as freenect
import kinect_lib.frame_convert as frame_convert
from freenect import sync_get_video as get_video
import os
import sys
import numpy as np
import signal
import cv2
from time import time

## write code to get take the kinect images and then convert frames to tf records
## tf records then get fed into the tf-models object recognition pipeline

KEEP_RUNNING = True


def run():
    start = time()
    while KEEP_RUNNING:
        rgb, _ = get_video()
        d3 = np.dstack((r,g,depth/20)).astype(np.uint8)
        da = np.hstack((d3,rgb[::2, ::2]))
        ## downsample image and then
        cv2.imshow('image', da)
        cv2.waitKey(0)
    return

if __name__ == '__main__':
    run()<commit_msg>added functionality to display kinect video<commit_after>#!/usr/bin/env python

from freenect import sync_get_video as get_video, sync_get_depth as get_depth
import freenect
import os
import sys
import numpy as np
import signal
import frame_convert2
from time import time
import cv2

## write code to get take the kinect images and then convert frames to tf records
## tf records then get fed into the tf-models object recognition pipeline

cv2.namedWindow('Depth')
cv2.namedWindow('RGB')
KEEP_RUNNING = True

def get_depth():
    return frame_convert2.pretty_depth_cv(freenect.sync_get_depth()[0])


def get_video():
    return frame_convert2.video_cv(freenect.sync_get_video()[0])

def run():
    while KEEP_RUNNING:
        # cv2.imshow('Depth', get_depth())
        cv2.imshow('Video', get_video())
        if cv2.waitKey(10) == 27:
            break

    # print('Press ESC in window to stop')
    # freenect.runloop(depth=display_depth,
    #                  video=display_rgb,
    #                  body=body)
    return

if __name__ == '__main__':
    run()
{'fraction_non_alphanumeric': 0.09169831795984808, 'fraction_numerical': 0.01410743353228432, 'mean_word_length': 3.4326923076923075, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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}}
{'dir': 'git-commits-cleaned', 'id': '587615', 'n_tokens_mistral': 605, 'n_tokens_neox': 592, 'n_words': 184}