This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import coremltools as ct | |
import numpy as np | |
import torch | |
from coremltools.models.neural_network import quantization_utils | |
from PIL import Image | |
from colorizers import siggraph17, load_img | |
from colorizers.siggraph17 import ModelHead | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
#if canImport(FoundationNetworking) | |
import FoundationNetworking | |
#endif | |
var semaphore = DispatchSemaphore (value: 0) | |
let parameters = [ | |
[ | |
"key": "image", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[tool.black] | |
line-length = 88 | |
target-version = ["py38"] | |
[tool.isort] | |
profile = "black" | |
multi_line_output = 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exclude: _pb2\.py$ | |
repos: | |
- repo: https://github.com/psf/black | |
rev: 22.3.0 | |
hooks: | |
- id: black | |
args: [ --skip-string-normalization ] | |
- repo: https://github.com/pre-commit/pre-commit-hooks | |
rev: v4.0.1 | |
hooks: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variety.viewport.typeset = function(strAddress) { | |
var driver = variety.viewport.driver; | |
delete driver.typesetString; | |
delete driver.typesetScale; | |
var s = this.recoverStrFromMemory(strAddress); | |
if(s == "0") s = "10"; | |
driver.typesetString = s.split('\n'); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. News Scrapper | |
GitHub: https://github.com/Vadbeg/NewsScrapper | |
Description: | |
Project for reading news from rss files. Includes command line utility and web application. | |
The main thing about this project is fasts, flexible and easy acces to news in format you want. | |
You can export every article into fb2, pdf and html. | |
Languages: | |
1. Python | |
Technologies: | |
1. Django |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def add_backgound(image): | |
""" | |
Adds background to given image using PIL | |
""" | |
image_shape = image.shape | |
image_height = image_shape[0] | |
image_width = image_shape[1] | |
backgound = create_blank_image(image_height, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create_blank_image(height, width, rgb_color=(0, 0, 255)): | |
""" | |
Creates np.array, each channel of which is filled with value from rgb_color | |
Was stolen from: | |
:source: https://stackoverflow.com/questions/4337902/how-to-fill-opencv-image-with-one-solid-color | |
""" | |
image = np.zeros((height, width, 3), np.uint8) | |
color = tuple(reversed(rgb_color)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def remove_background(img, threshold): | |
""" | |
This method removes background from your image | |
:param img: cv2 image | |
:type img: np.array | |
:param threshold: threshold value for cv2.threshold | |
:type threshold: float | |
:return: RGBA image | |
:rtype: np.ndarray |