This file contains hidden or 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
| from joblib import Parallel, delayed | |
| import numpy as np | |
| from skimage.transform import resize | |
| files = list(data.keys())[1:] | |
| def coords(filename): | |
| filename = filename.replace('11_1024/', '').replace('.jpg', '').replace('11_', '') | |
| filename = filename.replace('[','').replace(']','').split('_') |
This file contains hidden or 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
| # Original Matlab code https://cs.nyu.edu/~silberman/datasets/nyu_depth_v2.html | |
| # | |
| # | |
| # Python port of depth filling code from NYU toolbox | |
| # Speed needs to be improved | |
| # | |
| # Uses 'pypardiso' solver | |
| # | |
| import scipy | |
| import skimage |
This file contains hidden or 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
| #include "screengrab.h" | |
| void capture() | |
| { | |
| CComPtr<ID3D11Device> pDevice; | |
| CComPtr<IDXGIOutputDuplication> pDeskDupl; | |
| //(...)create devices and duplication interface etc here.. | |
| DXGI_OUTDUPL_DESC OutputDuplDesc; |
This file contains hidden or 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 subprocess | |
| import pathlib | |
| # Source | |
| map_server = 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/' | |
| # Output directory | |
| outdir = 'images/' | |
| pathlib.Path(outdir).mkdir(parents=True, exist_ok=True) |
This file contains hidden or 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
| // Product in default language | |
| { | |
| global $sitepress; | |
| $sitepress->switch_lang('en'); | |
| // Add the product (a post of type 'product') | |
| $post_id = wp_insert_post($post_data); | |
| // Attach media to it | |
| set_post_thumbnail( $post_id, get_post_id_by_title( $code, 'attachment' ) ); |
This file contains hidden or 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
| @keyframes shine{ | |
| 0% {background-position: top left;} | |
| 50% {background-position: top right;} | |
| 100% { | |
| background-position: top right; | |
| background: #e91e63; | |
| -webkit-background-clip: text; | |
| } | |
| } |
This file contains hidden or 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
| // Color map based on work by Kenneth Moreland: http://www.sandia.gov/~kmorel/documents/ColorMaps/ | |
| #pragma once | |
| #include <QVector> // or use std::vector | |
| inline std::vector< std::vector<double> > makeColorMap() | |
| { | |
| QVector<int> colorArray; | |
| colorArray <<59<<76<<192<<60<<78<<194<<61<<80<<195<<62<<81<<197<< | |
| 63<<83<<198<<64<<85<<200<<66<<87<<201<<67<<88<<203<<68<<90<<204<< | |
| 69<<92<<206<<70<<93<<207<<71<<95<<209<<73<<97<<210<<74<<99<<211<< |
This file contains hidden or 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
| #pragma once | |
| // Linear angle based parameterization SGP '07 - c++ code | |
| // Based on code by Rhaleb Zayer | |
| #include "SurfaceMeshModel.h" | |
| #include "SurfaceMeshHelper.h" | |
| using namespace SurfaceMesh; | |
| #include <Eigen/Core> |
This file contains hidden or 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
| Query: | |
| https://3dwarehouse.sketchup.com/search.html?q=chair | |
| Extract subjectIDs | |
| Then: | |
| https://3dwarehouse.sketchup.com/warehouse/getbinary?subjectId=XXXXXXXX&subjectClass=entity&cache=1440704568191&name=skj |
This file contains hidden or 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
| struct DisjointStrings{ | |
| DisjointStrings(QVector < QPair<QString, QString> > pairings = QVector < QPair<QString, QString> >()){ | |
| if (pairings.empty()) return; | |
| QSet<QString> all_nodes; | |
| for (auto p : pairings) { all_nodes << p.first; all_nodes << p.second; } | |
| DisjointSet U(all_nodes.size()); | |
| QMap < QString, int > node_idx; | |
| QMap < int, QString > idx_node; | |
| for (auto n : all_nodes) { node_idx[n] = node_idx.size(); idx_node[node_idx[n]] = n; } |