Saravanan666/pypi-org huggingface dataset:
Package: korbinian
Bioinformatic sequence analysis of membrane proteins.What is this repository for?Parsing of UniProt flatfilesDownloading homologues (primarily with SIMAP)Parsing BLAST-like XML filesAnalysis of protein sequencesAutomated figure creationLicensekorbinian is released under the permissive MIT licenceCreditsMark TeeseMartin OrtnerShenger WangRimma JenskeEnzo TorassoDominik MuellerCitationscientific publication to be addedcurrently cited as “the korbinian python package (Mark Teese, Technical University of Munich)”ContactFor contact details, see the image below.Further contact details are available at mystaff pagewithin theLangosch labof the Technical University of Munich.Example Summary FilesCompare three different membrane protein families:
Package: korbit
python-korbitis a Korbit API wrapper in Python.Environment VariablesYou will need to set a few environment variables to make this library work
properly.  A skeleton code is provided inprovision-dist.sh. Make a copy
and fill in values. API keys can be issued inhttps://www.korbit.co.kr/my/api/.cp provision-dist.sh provision.sh
source provision.shAPI Call ExamplesThis section illustrates how some of the API can be called.fromkorbit.apiimportget_transactionsget_transactions()This will fetch all transactions from the server producing an output as following:[
    {"timestamp":1389678052000,"tid":"22546","price":"569000","amount":"0.01000000"},
    {"timestamp":1389678017000,"tid":"22545","price":"580000","amount":"0.01000000"},
    {"timestamp":1389462921000,"tid":"22544","price":"569000","amount":"0.16348000"},
    {"timestamp":1389462921000,"tid":"22543","price":"570000","amount":"0.20000000"},
    {"timestamp":1389462920000,"tid":"22542","price":"578000","amount":"0.33652000"},
    ...
]Other functions are available and the usage of each function will be gradually added on this documentation in the future.
Package: korch
KorchSimple tools to provide a Keras-like interface to PyTorch.Installpip install korchExample of usageWe can perform a very simple example using the Fashion MNIST dataset (as is done in the officialPyTorch docs.transform = transforms.Compose(
    [transforms.ToTensor(),
    transforms.Normalize((0.5,), (0.5,))])

# Create datasets for training & validation, download if necessary
training_set = torchvision.datasets.FashionMNIST('./data', train=True, transform=transform, download=True)
validation_set = torchvision.datasets.FashionMNIST('./data', train=False, transform=transform, download=True)

# Create data loaders for our datasets; shuffle for training, not for validation
training_loader = torch.utils.data.DataLoader(training_set, batch_size=4, shuffle=True, num_workers=2)
validation_loader = torch.utils.data.DataLoader(validation_set, batch_size=4, shuffle=False, num_workers=2)See that the only different with respect to basic PyTorch is that we're inhereting from our customModule, not from PyTorch'snn.Module:class SimpleModel(Module):
    def __init__(self):
        super(SimpleModel, self).__init__()
        self.conv1 = nn.Conv2d(1, 6, 5)
        self.pool = nn.MaxPool2d(2, 2)
        self.conv2 = nn.Conv2d(6, 16, 5)
        self.fc1 = nn.Linear(16 * 4 * 4, 120)
        self.fc2 = nn.Linear(120, 84)
        self.fc3 = nn.Linear(84, 10)

    def forward(self, x):
        x = self.pool(F.relu(self.conv1(x)))
        x = self.pool(F.relu(self.conv2(x)))
        x = x.view(-1, 16 * 4 * 4)
        x = F.relu(self.fc1(x))
        x = F.relu(self.fc2(x))
        x = self.fc3(x)
        return xFollowing the usual Keras way, we instantiate the model and compile it, providing thelossand theoptimizer.Metricscan be provided as well, and are expected astorchvision.MetricCollection:model = SimpleModel()
model.compile(loss=torch.nn.CrossEntropyLoss(),
              optimizer=torch.optim.SGD(model.parameters(), lr=0.001, momentum=0.9),
              metrics = MetricCollection([Accuracy()]))modelSimpleModel(
  (conv1): Conv2d(1, 6, kernel_size=(5, 5), stride=(1, 1))
  (pool): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)
  (conv2): Conv2d(6, 16, kernel_size=(5, 5), stride=(1, 1))
  (fc1): Linear(in_features=256, out_features=120, bias=True)
  (fc2): Linear(in_features=120, out_features=84, bias=True)
  (fc3): Linear(in_features=84, out_features=10, bias=True)
  (loss_fn): CrossEntropyLoss()
)model.evaluate(training_loader), model.evaluate(validation_loader)(2.3070596095879874, 2.307082461261749)model.fit(trainloader=training_loader, epochs=1, validationloader=validation_loader)model.evaluate(training_loader), model.evaluate(validation_loader)(0.39349932589025605, 0.42693415356237674)
Package: kordar-task
多进程任务计算密集型应用# 实例化多进程任务句柄importtimefromkordar_taskimporttask,processmgr# work_size=工作进程（请设置小于cpu数据）# queue_buff_len=投递任务最大数量，send队列满则阻塞handler=processmgr.ProcessTaskHandler(work_size=5,queue_buff_len=20)# 添加任务逻辑handler.add_task(task.DefaultTask())# 启动任务处理器handler.start_work_pool()# 发送任务数据到进程队列handler.send(task.DefaultBody())handler.send(task.DefaultBody())time.sleep(10)基于异步IO的任务IO密集型应用# 实例化异步处理对象importtimefromkordar_taskimporttask,asyncmgr# work_size=工作池数量，根据实际情况设置，越大并发越高# queue_buff_len=投递任务最大数量，send队列满则异常h=asyncmgr.AsyncTaskHandler(work_size=5,queue_buff_len=20)# 添加异步任务# TODO 注意：设置task为异步处理函数h.add_task(task.DefaultAsyncTask())# 运行异步任务h.start_work_pool()# 向异步队列发送数据h.send(task.DefaultAsyncBody(1))h.send(task.DefaultAsyncBody(2))time.sleep(10)自定义任务fromkordar_task.taskimportibody,itaskfromkordar_taskimportwrite_loggerimportasyncio## 同步任务classDefaultBody(ibody):deftask_id(self):return"default-kordar_task"classDefaultTask(itask):defid(self):return"default-kordar_task"defexecute(self,body):write_logger("defaultTask, name =%s"%body.task_id())# 异步任务classDefaultAsyncBody(ibody):def__init__(self,tid):self.id=tiddeftask_id(self):return"default-kordar_async_task"classDefaultAsyncTask(itask):defid(self):return"default-kordar_async_task"asyncdefexecute(self,body):i=0whilei<5:write_logger("DefaultAsyncTask, id =%s"%body.id)i=i+1awaitasyncio.sleep(1)
Package: korean
Sometimes you should localize your project to Korean. But common i18n solutions
such as gettext are not working with non Indo-European language well. Korean
also has many morphological difference. “korean” a Python module provides
useful Korean morphological functions.Do not use “을(를)” anymore>>> from korean import Noun
>>> fmt = u'{subj:은} {obj:을} 먹었다.'
>>> print fmt.format(subj=Noun(u'나'), obj=Noun(u'밥'))
나는 밥을 먹었다.
>>> print fmt.format(subj=Noun(u'학생'), obj=Noun(u'돈까스'))
학생은 돈까스를 먹었다.LinksGitHub repositorydevelopment version
Package: koreanize-matplotlib
koreanize-matplotlibmatplotlib를 한국어 표시에 대응시킵니다.사용법matplotlib를 import한 후 koreanize_matplotlib를 import합니다.importmatplotlib.pyplotaspltimportkoreanize_matplotlibplt.plot([-1,0,1,2])plt.title('그래프 제목',fontweight="bold")plt.xlabel('간단한 그래프')plt.show()설치pipinstallkoreanize-matplotlib또는pythonsetup.pyinstall사용한 폰트나눔고딕
Package: korean-lunar-calendar
korean_lunar_calendar_py한국 양음력 변환OverviewHere is a library to convert Korean lunar-calendar to Gregoriancalendar.Korean calendar and Chinese calendar is same lunar calendar but havedifferent date.This follow the KARI(Korea Astronomy and Space Science Institute)한국 양음력 변환 (한국천문연구원 기준) - 네트워크 연결 불필요음력 변환은 1000년 01월 01일 부터 2050년 11월 18일까지 지원양력 변환은 1000년 02월 13일 부터 2050년 12월 31일까지 지원Gregorian calendar (1000-02-13 ~ 2050-12-31) <--> Korean lunar-calendar (1000-01-01 ~ 2050-11-18)Installpip install korean_lunar_calendarTo useimport modulefromkorean_lunar_calendarimportKoreanLunarCalendarKorean Solar Date -> Korean Lunar Date (양력 -> 음력)calendar=KoreanLunarCalendar()# params : year(년), month(월), day(일)calendar.setSolarDate(2017,6,24)# Lunar Date (ISO Format)print(calendar.LunarIsoFormat())# Korean GapJa Stringprint(calendar.getGapJaString())# Chinese GapJa Stringprint(calendar.getChineseGapJaString())[Result]

2017-05-01 Intercalation

정유년 병오월 임오일 (윤월)

丁酉年 丙午月 壬午日 (閏月)Korean Lunar Date -> Korean Solar Date (음력 -> 양력)# params : year(년), month(월), day(일), intercalation(윤달여부)calendar.setLunarDate(1956,1,21,False)# Solar Date (ISO Format)print(calendar.SolarIsoFormat())# Korean GapJa Stringprint(calendar.getGapJaString())# Chinese GapJa Stringprint(calendar.getChineseGapJaString())[Result]

1956-03-03

병신년 경인월 기사일

丙申年 庚寅月 己巳日
Package: korean-name-generator
Korean Name Generator한국어 이름을 랜덤으로 작명해 주는 라이브러리입니다. 남자 이름과 여자 이름 중 하나를 지정하면 그에 어울리는 이름이 생성됩니다.본 프로젝트는 npm의korean-name-generator를 python 패키지로 재배포한 프로젝트입니다.원작자에 대한 정보는여기서 확인해주세요.설치하기pip install korean-name-generator사용하기fromkorean_name_generatorimportnamer# 남자 이름 생성male_name=namer.generate(True)# 여자 이름 생성female_name=namer.generate(False)작명 원리초성, 중성, 종성의 자모별 연관 관계를인접행렬형태로 도출한 후, 아래와 같은 간단한 확률 모델을 사용하여어울릴 법한자모들을 조합하는 방식입니다. 초성이 선택되면 중성의 확률변수A가 정해지고, 중성이 정해지면 종성의 확률변수B*C가 정해집니다.현재 기본적으로 남자 이름은 약 10000개, 여자 이름은 1000개가 학습되어 있으나, 다른 이름을 학습 데이터로 사용할 수도 있습니다.fromkorean_name_generatorimportnamernames=['홍범도','안중근','유관순','이봉창','김좌진']# 학습trainedData=namer.train(names)# 학습된 데이터를 바탕으로 이름 생성name=namer.generateCustom(trainedData)라이센스이 프로젝트는MIT라이센스에 따라 자유롭게 이용 가능합니다.
Package: korean-school
korean_school_pyA python wrapper forNEIS OpenAPI이 파이썬 래퍼는NEIS OpenAPI를 위하여 제작된 라이브러리 입니다.설치(Installation)# Windowspy-3-mpipinstallkorean_school# Linux / MacOSpython3-mpipinstallkorean_school예제(Samples)Sample급식 정보 불러오기시간표 정보 불러오기학원 정보 불러오기급식 정보 불러오기importkorean_schoolimportasyncioasyncdefmain():client=korean_school.Client()school=awaitclient.school(name="<학교명>")meal=awaitschool[0].meal()print(meal[0].Meal)print(meal[0].allergy)print(meal[0].type)loop=asyncio.get_event_loop()loop.run_until_complete(main())# > ['칼슘수수밥k', '감자수제비국s', '메추리알곤약조림k', '애느타리깨소스무침k', '수제코다리살강정', '배추겉절이(입찰)k', '키위']# > [[], ['아황산염', '밀', '대두'], ['아황산염', '밀', '대두', '난류'], ['아황산염', '밀', '대두'], ['아황산염', '토마토', '밀', '대두', '난류'], ['아황산염', '새우'], []]# > 중식# 본 정보는 가락고등학교의 2021년 3월 19일 기준 중식 자료 입니다.시간표 정보 불러오기importkorean_schoolimportasyncioasyncdefmain():client=korean_school.Client()school=awaitclient.school(name="<학교명>")# 학년과 반은 int형이나, str으로 작성해도 문제 없음.timetable=awaitschool[0].timetable(grade="학년",class_nm="반")print("{}시간:{}".format(timetable[0].time,timetable[0].title))loop=asyncio.get_event_loop()loop.run_until_complete(main())# > 1시간: 자율활동# 본 정보는 가락고등학교 2학년 1반의 2021년 3월 2일 기준 자료 입니다.학원 정보 불러오기importkorean_schoolimportasyncioasyncdefmain():client=korean_school.Client()# 학원 정보를 불러 올때에는 무조건 시/도 지역을 지정해주셔야합니다.academy=awaitclient.academy(provincial_code=korean_school.Location.Seoul,name="<학원명>")print(academy[0].name)print(academy[0].address1)print(academy[0].address2)loop=asyncio.get_event_loop()loop.run_until_complete(main())사용권(License)MIT LicenseCopyright (c) 2021 gunyu1019
Package: korean-word-relay
korean-word-relay끝말잇기 package for python한국어 낱말 게임 끝말잇기를 쉽게 커스터마이징 할 수 있는 패키지모델이 사용할 끝말잇기 단어 직접 선택 (난이도 조절 가능)두음법칙 적용 (여부 선택)이전 단어와 이어지지 않거나 이미 나왔던 단어 입력시 패배InstallationUsingpip:pip install korean-word-relayUsageQuick Startfromkorean_word_relayimportWordRelayword_relay=WordRelay()word_relay.play()result--------------끝말잇기----------------
시작 단어: 파이썬
<< 썬샤인
>> 인간
<< 간택
>> 택시
<< 시리
>> 리그
<< 그대
>> 대략
<< 약관
>> 관람
<< 람보
>> 보도
<< 도로묵
------------------------------
no word to answer
YOU WIN!Default optional parameterword_relay=WordRelay(import_default=True,words_path=None,use_dueum=True,debug_print=True):)import_default(boolean): If True, import candidates of korean words from'자주 쓰이는 한국어 낱말 모음 5800'words_path(None|string): If given path(.txt), import candidates of words list from txt fileuse_dueum(boolean): If True, 두음법칙 is alloweddebug_print(boolean): If True, print warning message on consoleExample format for words_pathwords_pathshould beNoneorlist of korean words in txt extension. For instance,word_list.txtshould be사랑
우정
믿음
.
.
여자친구If you want to make game much difficult, getkilling_words.txtfromhere.Methods of WordRelayword_relay=WordRelay()# 주어진 낱말에 이어지는 단어 리턴# set log_history=False if you don't want to add word in historynext_word=word_relay.get_next('성질')# next_word is None or 질X (예: 질문)# 두 낱말이 이어지는지 여부 체크is_continue=word_relay.check_continue('질문','문지기')# is_continue == True# 특정 낱말을 이미 나온말(history)에 추가word_relay.add_history('문지기')print(word_relay.history)# word_relay.history = ['질문', '문지기'], 질문 was added get_next above# history 를 초기화word_relay.reset()print(word_relay.history)# word_relay.history = []etcChecking whether word is valid or not is not implemented in this project, since 1. criteria forvalid languageis keep changing, 2. including korean dictionary can make this package too big. You can implement your own code to check whether word is valid or not.
Package: korea-public-data
Korea Public DATA공공 데이터를 간편히 조회 할 수 있는 파이썬 라이브러리WebsiteGithub :https://github.com/ja-y-com/korea-public-data/Installpipinstallkorea-public-dataExample# ------------------------# 국토교통부_아파트매매 실거래자료# ------------------------service_key=<서비스키>app_name="getRTMSDataSvcAptTrade"# 앱controller=PublicDataController(app_name).set_keys(service_key=service_key)# 기본 데이터 조회controller.data# 마포, 어제 일자로 데이터 조회# 변수 변경controller.location_code=<지역코드>
controller.date_to_str=<조회일(YYYYMM)>
controller.data# 원하는 지역, 일자 데이터 조회Apps구분앱파라미터 정보국토교통부_아파트매매 실거래자료getRTMSDataSvcAptTradeservice_key(str), location_code(str), search_date(str: YYYYMM)국토교통부_아파트매매 실거래 상세 자료getRTMSDataSvcAptTradeDevservice_key(str), location_code(str), search_date(str: YYYYMM), page_no(int), num_of_rows(int)공공데이터활용지원센터_보건복지부 코로나19 감염 현황getCovid19InfStateJsonservice_key(str), start_at(str: YYYYMMDD), end_at(str: YYYYMMDD), page_no(int), num_of_rows(int)사업자 등록정보 진위확인 및 상태조회nTSBusinessManservice_key(str), business_no(list)서울 버스 노선 정보getStationByRouteservice_key(str), bus_route_id(str)현재 환율 APIexchangeJSONauth_key(str), search_date(str: YYYYMMDD)지역별 성범죄자 통계sOCityStats-일별 박스 오피스 순위searchDailyBoxOfficeListkey(str), target_dt(str: YYYYMMDD), item_per_page(str), multi_movie_yn(Y or N), rep_nation_cd(K or F), wide_area_cd(str)대기 오염 상태 조회getMinuDustWeekFrcstDspthservice_key(str), search_date(str: YYYY-MM-DD), page_no(int), num_of_rows(int)변수 중굵게표시된 부분은 Controller 생성시 사용되는 파라미터입니다Environment프로그램 실행을 위해선 아래 버전 준수가 요구됩니다.Python3.7이상Release Note0.0.1최초 배포범용적 데이터 조회 구조 제작사용자의 편의를 최우선으로 고려기본 데이터가 입력되어있어 간단히 테스트 가능0.0.2-3참조 라이브러리 추가README 수정(홈페이지 적용 등)0.0.4기능 추가(지역별 성범죄자 통계 및 일별 박스 오피스 등)불필요한 코드 제거클래스 참조 방식 변경0.0.5기능 추가(대기 오염 상태 조회)추가 설치된 라이브러리 기능 내부에 추가Thank You우선 해당 라이브러리에 관심을 주셔서 감사합니다.많은 서비스를 간편히 사용할 수 있도록 지속적으로 업데이트 할 예정입니다.추가 문의나 요청 사항 등이 있으시면 아래 이메일로 문의주세요.ContactJAY |root@ja-y.com
Package: korea-school-meal
Korea School Meal대한민국 학교들의 급식 정보를 알려줍니다. 모든 정보는NEIS에서 얻어옵니다.How To Use> pip install korea_school_meal
> from korea_school_meal import meal, neis_codeneis_code.py- 각 학교의 NEIS 코드를 가져옵니다.> neis_code.get_code('이의고등학교')
> {'이의고등학교': {'코드': 'J100006813', '교육청': '경기', '종류': '04'}}meal.py- 지정일의 급식을 가져옵니다.> meal.get_meal('J100005882', '경기', '04', datetime.datetime(2019, 10, 10))
> ['[중식]', '우유', '차조밥', '오징어찌개', '새송이버섯불고기', '녹두빈대떡', '열무김치', '머루포도']Troubleshooting문제가 있다면 issue를 남겨주세요.made by moseoridev with <3
Package: koremutake
Koremutake is a 128bit MeRS encoding algorithm that can convert any large,
unsigned number into a memorable sequence of phonetically unique syllables.For details seehttp://shorl.com/koremutake.phpTo install, run ‘sudo easy_install koremutake’>>> import koremutake
>>> koremutake.encode(10610353957)
'koremutake'
>>> koremutake.decode('koremutake')
10610353957
Package: korg
korg is the python port for the ruby logstash grok regular expression
patterns.QuickstartLogstash comes with over a 100 built in patterns for structuring
unstructured data. You should definitely take advantage of this when you
work with log data like like from apache, linux, haproxy, aws, and so
forth. But you should also use it when working with unstructured data
and you simply provide custom pattern yourself.In this demo I quickly show you how to use it on a simple webserver log
sample:Serving HTTP on 0.0.0.0 port 8080 (http://0.0.0.0:8080/) ...
127.0.0.1 - - [18/Jan/2020 10:28:19] "GET /index.html HTTP/1.1" 404 -
127.0.0.1 - - [18/Jan/2020 10:28:27] "GET /secret.txt HTTP/1.1" 200 -
...Usually I start by putting a sample log line intoGrok
Debuggerand develop the pattern
by using the logstash patterns (like what you would do using ruby
logstash). Grok patterns are structured like this: %{NAME:IDENTIFIER}.
NAME is the name of the logstash pattern you want to use, IDENTIFIER is
the identifier you are giving to the matched text.webserver log patternOnce the pattern works (should try out other log lines, too) we can
automate this using korg.>>>fromkorgimportLineGrokker,PatternRepo>>>>>>pr=PatternRepo()# use the std. logstash grok patterns>>>lg=LineGrokker('%{IPORHOST:clientip} - - %{SYSLOG5424SD}"(?:%{WORD:verb} %{NOTSPACE:request}(?: HTTP/%{NUMBER:httpversion})?|%{DATA:rawrequest})" %{NUMBER:response} (?:%{NUMBER:bytes}|-)',pr)>>>>>>print(lg.grok('''127.0.0.1 - - [18/Jan/2020 10:28:27] "GET /secret.txt HTTP/1.1" 200 -''')){'clientip':'127.0.0.1','verb':'GET','request':'/secret.txt','httpversion':'1.1','rawrequest':None,'response':'200','bytes':None}Why a logstash / grok port to Python?I like the logstashgrokapproach to logfile parsing. So I want to
use this in Python.One solution would be to use the C version of logstash / grok
(https://github.com/jordansissel/grok) and to write a wrapper:https://github.com/kiwi0530/python-grokhttps://github.com/emgee/libgrok-pyBasically grok assembles regular expressions. I already know that in
Python file processing with regular expressions is blazingly fast so I
choose to directly port it to Python.The pattern files are updated from the logstash grok project:https://github.com/logstash-plugins/logstash-patterns-coreA big thank you belongs to the logstash community for an awesome job
maintaining the regex pattern files!Resourceshttp://jpmens.net/2012/08/06/my-logstash-and-graylog2-notes/http://grokdebug.herokuapp.com/
Package: korgwslib
This package provides an API to handle MIDI system exclusive data for the
Korg Wavestation line of synthesizers.Currently it can read performance, patch and wavesequence data and provides
methods to query basic information from these objects.This software is still in alpha stage, so much intended functionality is still
missing. For the moment, the most useful part is an included script to list
performances, patches and wave sequences in Wavestation sysex dump files.
Package: korhal
KorhalKorhal(KOrean Rpc-based Handy Application for Language-processing) is a python wrapper for several korean Part-Of-Speech taggers.How to installpipinstallkorhalAvailable taggersKOMORAN withkorhal.komoranHannanum withkorhal.hannanumOpen-source Korean Text Processor withkorhal.openkoreantextHow to usefromkorhal.komoranimporttokenizeresult=tokenize("집에 가서 잠을 자고 싶다")# result => Token(text=집,pos=NNG), Token(text=에,pos=JKB), Token(text=가,pos=VV), Token(text=아서,pos=EC), Token(text=잠,pos=NNG), Token(text=을,pos=JKO), Token(text=자,pos=VV), Token(text=고,pos=EC), Token(text=싶,pos=VX), Token(text=다,pos=EC)]print(result.text)# => 집print(result.pos)# => NNGnouns=[token.textfortokeninresultiftoken.pos.startswith('N')]Asynchronous methodsWithkorhal.aio, you can use asynchronous methods. The performance of multi-core systems can be slightly improved when performing extensive processing.fromkorhal.aio.opentextkoreanimporttokenizetexts=['달디단 맛있는 케이크가 있었다','솜사탕 같이 귀여운 구름']futures=[tokenize(text)fortextintexts]results=[f.result()forfinfutures]Thanks toKOMORANHannanumOpen-source Korean Text ProcessorKoalaNLP
Package: kornia-moons
Kornia_moonsInstallpip install kornia_moonsHow to useHere is an example how to use kornia-moons for local feature conversion
from OpenCV ORB keypointsimportmatplotlib.pyplotaspltimportcv2importtorchimportkorniaasKfromtypingimportListimportmatplotlib.pyplotaspltfromkornia_moons.featureimportlaf_from_opencv_ORB_kpts,opencv_ORB_kpts_from_laffromkornia_moons.vizimportvisualize_LAFimg=cv2.cvtColor(cv2.imread('data/strahov.png'),cv2.COLOR_BGR2RGB)det=cv2.ORB_create(500)kps,descs=det.detectAndCompute(img,None)out_img=cv2.drawKeypoints(img,kps,None,flags=cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS)plt.imshow(out_img)lafs=laf_from_opencv_ORB_kpts(kps)visualize_LAF(K.image_to_tensor(img,False),lafs,0)kps_back=opencv_ORB_kpts_from_laf(lafs)out_img2=cv2.drawKeypoints(img,kps_back,None,flags=cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS)plt.imshow(out_img2)libpng warning: iCCP: known incorrect sRGB profile<matplotlib.image.AxesImage>
Package: kornia-rs
kornia-rs: Low level implementations for Computer Vision in Rust.This project provides low level functionality for Computer Vision written inRustto be consumed by machine learning and data-science frameworks, specially those working with images. We mainly aim to provide I/O functionality for images (future: video, cameras), and visualisation in future.The library is written inRust.Python bindings are created withPyO3/Maturin.We package with support for Linux [amd64/arm64], Macos and WIndows.Supported Python versions are 3.7/3.8/3.9/3.10/3.11Basic UsageLoad an image, that is converted tocv::Tensorwich is a centric structure to the DLPack protocol to share tensor data across frameworks with a zero-copy cost.importkornia_rsasKfromkornia_rsimportTensorascvTensor# load an image with Rust `image-rs` as backend librarycv_tensor:cvTensor=K.read_image_rs("dog.jpeg")assertcv_tensor.shape==[195,258,3]# convert to dlpack to import to torchth_tensor=torch.utils.dlpack.from_dlpack(cv_tensor)assertth_tensor.shape==(195,258,3)assertnp_tensor.shape==(195,258,3)# or to numpy with same interfacenp_tensor=np.from_dlpack(cv_tensor)Advanced usageEncode or decoda image streams using theturbojpegbackend# load image using turbojpegcv_tensor=K.read_image_jpeg("dog.jpeg")image:np.ndarray=np.from_dlpack(cv_tensor)# HxWx3# encode the image with jpegimage_encoder=K.ImageEncoder()image_encoder.set_quality(95)# set the encoding quality# get the encoded streamimage_encoded:List[int]=image_encoder.encode(image.tobytes(),image.shape)# write to disk the encoded streamK.write_image_jpeg("dog_encoded.jpeg",image_encoded)# decode back the imageimage_decoder=K.ImageDecoder()decoded_tensor=image_decoder.decode(bytes(image_encoded))decoded_image:np.ndarray=np.from_dlpack(decoded_tensor)# HxWx3TODO: short/mid-terrm[infra] Automate packaging for manywheels.[kornia] integrate with the newImageAPI[dlpack] move dlpack implementation to dlpack-rs.[dlpack] implement test for torch and numpy.[dlpack] update dlpack version >=0.8[dlpack] implementDLPacktocv::Tensor.TODO: not priority for now[io] Implement image encoding and explore video.[viz] Fix minor issues and implement a fullVizManagerto work on the browser.[tensor] implement basic functionality to test: add, sub, mul, etc.[tensor] explore xnnpack and openvino integration.DevelopmentTo test the project in lyour local machine use the following instructions:Clone the repository in your local directorygitclonehttps://github.com/kornia/kornia-rs.git2.1 (optional) Build thedevel.DockerfileLet's prepare the development environment with Docker.
Make sure you have docker in your system:https://docs.docker.com/engine/install/ubuntu/cd./docker&&./build_devel.shKORNIA_RS_DEVEL_IMAGE="kornia_rs/devel:local"./devel.sh2.2 Enter to thedeveldocker container../devel.shBuild the project(you should now be inside the docker container)# maturin needs you to be a `venv`python3-mvenv.venvsource.venv/bin/activate# build and generate linked wheelsmaturindevelop--extrasdevRun the testspytesttest/ContributingThis is a child project ofKornia. Join the community to get in touch with us, or just sponsor the project:https://opencollective.com/kornia
Package: korNum
korNumChange[Korean number text -> Arabic number]or[Arabic number -> Korean number text]Installationpypi:pip install korNumsource code:gitclonehttps://github.com/study-ai-data/korNum.gitcdkorNum
pythonsetup.pyinstallGetting Startedpypi>>>fromkorNum.chgFormatimportkor2num>>>text1="맛있는 포카칩이 구천팔백칠십육억오천사백삼십이만천백십일원!">>>print(kor2num(text1))맛있는포카칩이987654321111원!>>>text2="맛있는 포카칩이 구천팔백칠십육억오천사백삼십이만천백십일원에서 오백십만육십구원, 만사천칠백원을 거쳐 이제는 천오백원으로!">>>print(kor2num(text2))맛있는포카칩이987654321111원에서5100069원,14700원을거쳐이제는1500원으로!source code:python run.pyNoteonly operate about cardinal number(기수: 일, 이, 삼, 사, ...) text -> real numYou can see more information here:docs/README.md