th> lyaml = require 'lyaml'
[0.0016s]
th> out = lyaml.load('key: null')
[0.0002s]
th> out.key
null
[0.0000s]
th> type(out.key)
string
This file contains 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
# This script installs (or at least, attempts to install) Caffe in CPU mode | |
# with Python bindings without root permission. In doing so, it installs the | |
# following dependencies: | |
# | |
# * protobuf | |
# * cmake | |
# * gflags | |
# * glog | |
# * opencv | |
# * hdf5 |
This file contains 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
#!/bin/bash | |
### | |
# Patch CLIP models to work with PyTorch versions before 1.7. | |
# This script was tested with PyTorch 1.6 and CUDA 9.2 on the RN-50 and ViT-B-32 models. | |
### | |
if [[ "$#" != 1 ]] ; then | |
echo "Usage: $0 <clip-model-pt>" | |
echo "Example: $0 $HOME/.cache/clip/RN50.pt" | |
exit 1 |
This file contains 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
{"id": "lvis", "name": "LVIS", "children": [{"id": 1, "name": "entity.n.01", "children": [{"id": 194, "name": "physical_entity.n.01", "children": [{"id": 459, "name": "object.n.01", "children": [{"id": 2018, "name": "part.n.02", "children": [{"id": 1584, "name": "piece_of_cloth.n.01", "children": [{"id": 1590, "name": "sail.n.01", "children": []}, {"id": 1585, "name": "towel.n.01", "children": [{"id": 508, "name": "bath_towel.n.01", "children": []}, {"id": 1588, "name": "paper_towel.n.01", "children": []}, {"id": 1587, "name": "hand_towel.n.01", "children": []}, {"id": 1586, "name": "dishtowel.n.01", "children": []}]}, {"id": 1592, "name": "bandanna.n.01", "children": []}, {"id": 1589, "name": "dishrag.n.01", "children": []}]}, {"id": 2028, "name": "doorknob.n.01", "children": []}, {"id": 2024, "name": "wall_socket.n.01", "children": []}]}, {"id": 460, "name": "whole.n.02", "children": [{"id": 1986, "name": "natural_object.n.01", "children": [{"id": 2017, "name": "nest.n.01", "children": []}, {"id": 1991, "na |
This file contains 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
#!/bin/bash | |
# Save current git diff, log, status to output directory. | |
# | |
# Example usage: | |
# ./dump_git_info.sh /path/to/output/directory/ | |
# ./dump_git_info.sh /path/to/output/directory/ /path/to/git/repo/ | |
# | |
# Writes the following files to output_dir: | |
# | |
# git-status.txt: Output of git status -sb. |
This file contains 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
"""Use argparse to load arguments from file before command line. | |
MIT License | |
Copyright (c) 2018 Achal Dave | |
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 |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
function readImage(aFile) { | |
var pic = new Image(), | |
frd = new FileReader(); | |
while (!target.droppedImage) { | |
target = target.parent; | |
} | |
pic.onload = function () { | |
canvas = newCanvas(new Point(pic.width, pic.height)); | |
canvas.getContext('2d').drawImage(pic, 0, 0); | |
target.droppedImage(canvas, aFile.name); |
This file contains 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
"""Dump features calculated from a network using Caffe. | |
Run 'python frame_features.py --help' for usage information. | |
""" | |
import argparse | |
import csv | |
import errno | |
import logging | |
import numpy as np |
This file contains 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
--[[ Displays memory 'leak' with nn.MapTable after clearState() ]]-- | |
local nn = require 'nn' | |
local cunn = require 'cunn' | |
model = nn.MapTable():add(nn.SpatialConvolution(3, 256, 3, 3, 1, 1, 1, 1, 1)) | |
:cuda() | |
i = {torch.rand(30, 3, 224, 224):cuda(), torch.rand(30, 3, 224, 224):cuda()} | |
function check_mem() os.execute('nvidia-smi | grep luajit') end |
NewerOlder