Skip to content

Instantly share code, notes, and snippets.

View noskill's full-sized avatar

Anatoly Belikov noskill

  • SingularityNet
  • Russia, Chekhov
View GitHub Profile
import os
from diffusers import StableDiffusionPipeline
import torch
model_id = "dreamlike-art/dreamlike-photoreal-2.0"
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
pipe = pipe.to("cuda")
prompt = "photo, a church in the middle of a field of crops, bright cinematic lighting, gopro, fisheye lens"
@noskill
noskill / hello_world_diffusers.py
Created November 7, 2023 08:19
hello world in diffusers
from diffusers import StableDiffusionPipeline
pipe = StableDiffusionPipeline.from_pretrained("hf-internal-testing/tiny-stable-diffusion-torch")
prompt = "a photo of an astronaut riding a horse on mars"
pipe.enable_attention_slicing()
image = pipe(prompt).images[0]
print(image)
@noskill
noskill / gen.py
Created September 11, 2023 09:57
generate mech warrior image with diffusers
import torch
import random
from diffusers import StableDiffusionKDiffusionPipeline
from diffusers import StableDiffusionPipeline, StableDiffusionLatentUpscalePipeline
from transformers import CLIPProcessor, CLIPTextModel
from diffusers.schedulers import DPMSolverMultistepScheduler
class MyPipe:
@noskill
noskill / project3d.py
Last active July 13, 2023 07:51
2.5D image rotation
"""
Code for 2.5D rotation
"""
import cv2
from PIL import Image
import os
import numpy
import numpy as np
@noskill
noskill / PA166181140.xml
Created May 18, 2020 13:28
PA166181140
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:bp="http://www.biopax.org/release/biopax-level3.owl#">
<owl:Ontology rdf:about="">
<owl:imports rdf:resource="http://www.biopax.org/release/biopax-level3.owl#" />
</owl:Ontology>
@noskill
noskill / pharma2uniprot.tsv
Created April 17, 2020 11:07
pharmagkb to uniprot mapping
pharma_id Entry Entry name Status Protein names Gene names Organism Length
A5X5Y0 A5X5Y0 5HT3E_HUMAN reviewed 5-hydroxytryptamine receptor 3E (5-HT3-E) (5-HT3E) (Serotonin receptor 3E) HTR3E Homo sapiens (Human) 456.0
Q6NWU0 Q6NWU0 Q6NWU0_HUMAN unreviewed Cytochrome P450 2D6 (EC 1.14.14.1) (Cytochrome P450 2D6 variant) (Cytochrome P450, family 2, subfamily D, polypeptide 6) CYP2D6 Homo sapiens (Human) 497.0
Q6NXU8 P10635 CP2D6_HUMAN reviewed Cytochrome P450 2D6 (EC 1.14.14.-) (CYPIID6) (Cholesterol 25-hydroxylase) (Cytochrome P450-DB1) (Debrisoquine 4-hydroxylase) CYP2D6 CYP2DL1 Homo sapiens (Human) 497.0
Q70Z44 Q70Z44 5HT3D_HUMAN reviewed 5-hydroxytryptamine receptor 3D (5-HT3-D) (5-HT3D) (Serotonin receptor 3D) HTR3D Homo sapiens (Human) 454.0
Q8WXA8 Q8WXA8 5HT3C_HUMAN reviewed 5-hydroxytryptamine receptor 3C (5-HT3-C) (5-HT3C) (Serotonin receptor 3C) HTR3C Homo sapiens (Human) 447.0
B4E398 B4E398 B4E398_HUMAN unreviewed cDNA FLJ61569, highly similar to 5-hydroxytryptamine 3 receptor Homo sapiens (Human) 4
@noskill
noskill / cov.scm
Last active April 14, 2020 14:47
covid related interactions
(EvaluationLink
(PredicateNode "has_entrez_id")
(ListLink
(GeneNode "RCHY1")
(ConceptNode "entrez:25898")))
(EvaluationLink
(PredicateNode "has_entrez_id")
(ListLink
(GeneNode "CAMK2D")
(ConceptNode "entrez:817")))
@noskill
noskill / pharmagkb.scm
Last active May 8, 2020 12:07
pharmagkb pathways
This file has been truncated, but you can view the full file.
(EvaluationLink
(PredicateNode "has_name")
(ListLink
(ConceptNode "PA166179790")
(ConceptNode "Tropisetron Pathway, Pharmacokinetics/Pharmacodynamics")))
(InheritanceLink
(ConceptNode "PA166179790")
(ConceptNode "pathway"))
(MemberLink
(MoleculeNode "Uniprot:A5X5Y0")
@noskill
noskill / example.py
Last active February 26, 2020 14:22
multiindex dataframe in pandas
import pandas as pd
from pandas.core.indexes.api import ensure_index_from_sequences
col_dict = {'FrameId':(0,), 'Id':(1,), 'X': (321.89,), 'Y': (381.81,), 'Width': (39.45,), 'Height': (49.45,), 'ClassId': (-1,), 'Visibility': (-1,), 'unused': (-1,)}
names = ['X', 'Y', 'Width', 'Height', 'Confidence', 'ClassId', 'Visibility', 'unused']
arrays = col_dict['FrameId'], col_dict['Id']
@noskill
noskill / converter.py
Last active February 18, 2020 13:40
GQA to logic
import re
from collections import defaultdict
import json
two_args_re = re.compile('^([\w\s]+)\((\d+)\)')
two_args_re_no = re.compile('^([\w\s]+)\((-)\)')
many_objects = re.compile('^(\w+)\s\((\d+(\,\d+)+)\)')
one_word = re.compile('^(\w+)($)')
s_re = re.compile('([s|o])\s\((.*)\)')