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

import sys
if len(sys.argv) < 3:
    print("Usage: cmdline.py <imagefile> <outputfile> [colorization|rendering|recolorization]")
    exit()

from config import *

import re
import os
import cv2
import time
import json
import base64
import shutil
import datetime
import threading
import numpy as np

from ai import *
from tricks import *


sketch_upload_pool = []
painting_pool = []
options_str = '{"alpha":0,"points":[],"lineColor":[0,0,0],"line":false,"hasReference":false}'


def get_request_image(fname):
    img = np.fromfile(fname, dtype=np.uint8)
    img = cv2.imdecode(img, -1)
    return img


def handle_sketch_upload_pool():
    room, sketch, method = sketch_upload_pool[0]<commit_msg>Commandline tool will check that neural network data is downloaded<commit_after>#!/usr/bin/env python3

import os
import sys

for f in ['baby.net', 'head.net', 'neck.net', 'tail.net', 'reader.net', 'girder.net']:
    if not os.path.exists(f):
        print('Error: neural network models not downloaded!')
        print('Download them here, and put to current directory:')
        print('https://drive.google.com/open?id=1fWi4wmNj-xr-nCzuWMsN2rcm0249_Aem')
        exit(1)

if len(sys.argv) < 3:
    print('Usage: cmdline.py <imagefile> <outputfile> [colorization|rendering|recolorization]')
    exit(1)


from config import *

import re
import cv2
import time
import json
import base64
import shutil
import datetime
import threading
import numpy as np

from ai import *
from tricks import *


sketch_upload_pool = []
painting_pool = []
options_str = '{"alpha":0,"points":[],"lineColor":[0,0,0],"line":false,"hasReference":false}'


def get_request_image(fname):
    img = np.fromfile(fname, dtype=np.uint8)
    img = cv2.imdecode(img, -1)
    return img


def handle_sketch_upload_pool():
    room, sketch, method = sketch_upload_pool[0]
{'fraction_non_alphanumeric': 0.12987707108498128, 'fraction_numerical': 0.01870657402458578, 'mean_word_length': 4.7073170731707314, 'pattern_counts': {'":': 10, '<': 9, '<?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': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4969621', 'n_tokens_mistral': 661, 'n_tokens_neox': 638, 'n_words': 164}