Skip to content

Instantly share code, notes, and snippets.

View Owen-Liuyuxuan's full-sized avatar

Yuxuan Liu Owen-Liuyuxuan

View GitHub Profile
@autosquid
autosquid / opencvyaml1-1.py
Last active September 26, 2022 08:08
pyyaml loading opencv yaml
# construct node
def opencv_matrix(loader, node):
mapping = loader.construct_mapping(node, deep=True)
mat = np.array(mapping["data"])
mat.resize(mapping["rows"], mapping["cols"])
return mat
yaml.add_constructor(u"tag:yaml.org,2002:opencv-matrix", opencv_matrix)
# loading
@rezoo
rezoo / numpy.hpp
Last active April 14, 2024 17:37
Reimplementation of libnpy. This library is header-only and compatible with any environment including MSVC.
/*
* Copyright (c) 2012 Masaki Saito
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*