Warning
To access the discord post links please join the TouhouAI (24k members) discord server.
WIP
| /*自定义样式,实时生效*/ | |
| /* 全局属性 | |
| * 页边距 padding: 30px; | |
| * 全文字体 font-family: ptima-Regular; | |
| * 英文换行 word-break: break-all; | |
| */ | |
| #nice { | |
| font-size: 14px; | |
| letter-spacing: 0.05em; |
| from dataclasses import dataclass | |
| import threading, signal | |
| import queue | |
| import time | |
| @dataclass | |
| class JobTask: | |
| is_even: bool = False | |
| idx: int = 0 | |
| tm: int = 0 |
Warning
To access the discord post links please join the TouhouAI (24k members) discord server.
WIP
| #!/usr/bin/env python | |
| """Simple HTTP Server With Upload. | |
| This module builds on BaseHTTPServer by implementing the standard GET | |
| and HEAD requests in a fairly straightforward manner. | |
| """ | |
| __version__ = "0.2" | |
| __all__ = ["SimpleHTTPRequestHandler"] |
| These commands are based on a askubuntu answer http://askubuntu.com/a/581497 | |
| To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below. | |
| USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING. | |
| ABSOLUTELY NO WARRANTY. | |
| If you are still reading let's carry on with the code. | |
| sudo apt-get update && \ | |
| sudo apt-get install build-essential software-properties-common -y && \ | |
| sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \ |
| // clang gpu_compiler.m -fobjc-arc -fmodules -mmacosx-version-min=11.0 -framework Foundation -framework CoreGraphics -o gpu_compiler | |
| #import <Foundation/Foundation.h> | |
| #import <Metal/Metal.h> | |
| void compile_to_gpu_code(id<MTLDevice> device, NSString *programString, NSString *destinationPath) { | |
| NSError *error; | |
| MTLCompileOptions *options = [MTLCompileOptions new]; | |
| options.libraryType = MTLLibraryTypeDynamic; | |
| options.installName = [NSString stringWithFormat:@"@executable_path/userCreatedDylib.metallib"]; |
| #include <iostream> | |
| #ifdef _WIN32 | |
| // For __cpuid | |
| #include <intrin.h> | |
| #endif | |
| #define uint32_t unsigned int | |
| struct CPUID { |
| #include <vector> | |
| #include <opencv2/imgcodecs.hpp> | |
| #include <opencv2/highgui.hpp> | |
| #include <opencv2/imgproc.hpp> | |
| namespace ImageUtils { | |
| // imagenet preprocessing function | |
| cv::Mat preprocess_image(cv::Mat image) { | |
| cv::Mat float_image; | |
| image.convertTo(float_image, CV_32FC3); |