Skip to content

Instantly share code, notes, and snippets.

pillow : img.show()
opencv:
cv2.namedWindow('image', cv2.WINDOW_NORMAL)
cv2.imshow('image',croppedImg)
cv2.waitKey(0)
cv2.destroyAllWindows()
@GTimothee
GTimothee / primes.py
Created March 24, 2019 18:37
prime functions
def is_prime_number(x):
''' Function to know if x is a prime number.
'''
for i in range(floor(sqrt(x))):
if x % i == 0:
return False
return True
def sieve_of_eratosthenes(start, end):
''' Brute force method to compute primes.
@GTimothee
GTimothee / streamlit_feedback_app.py
Created June 13, 2024 07:51
basic feedback collection snippet with streamlit_feedback
import streamlit as st
from streamlit_feedback import streamlit_feedback
import logging
import uuid
logging.basicConfig(level=logging.INFO)
def reset_key():
st.session_state['ss_key'] = str(uuid.uuid4())
@GTimothee
GTimothee / load-and-save-embed-model.ipynb
Created November 14, 2024 17:09
load and save embed model.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
"""
pip install lightrag-hku
"""
import os
import asyncio
import numpy as np
from tqdm import tqdm
from lightrag import LightRAG, QueryParam
from lightrag.llm.openai import gpt_4o_mini_complete, gpt_4o_complete, openai_embed, openai_complete_if_cache
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.