Skip to content

Instantly share code, notes, and snippets.

@smzn
smzn / geometric.html
Last active Oct 4, 2020
幾何分布の適合度検定
View geometric.html
def getCSV(file):
return pd.read_csv(file, engine='python')
use_day = getCSV('use_day.csv')
use_day
plt.bar(range(30), use_day['frequency'])
#幾何分布で作成した度数
plt.bar(range(30), use_day['geometric'])
View pview.ctp
<div class="streets view">
<h2><?php echo __('Street'); ?></h2>
<?php $path = IMAGES;?>
<?php echo $this->Html->image('/img/image/' . $street['Street']['photo0_0']); ?>
<?php echo $this->Html->image('/img/image/' . $street['Street']['photo0_45']); ?>
<?php echo $this->Html->image('/img/image/' . $street['Street']['photo90_0']); ?>
<?php echo $this->Html->image('/img/image/' . $street['Street']['photo90_45']); ?>
<?php echo $this->Html->image('/img/image/' . $street['Street']['photo180_0']); ?>
<?php echo $this->Html->image('/img/image/' . $street['Street']['photo180_45']); ?>
<?php echo $this->Html->image('/img/image/' . $street['Street']['photo270_0']); ?>
View gist:6f9f583f37605b94cb5f104fbc62e81e
<div class="streets view">
<h2><?php echo __('Street'); ?></h2>
<?php $id = "naisyo";?>
<img src="https://maps.googleapis.com/maps/api/streetview?location=<?php echo h($street['Street']['latitude']); ?>, <?php echo h($street['Street']['longitude']); ?>&size=456x456&heading=0&pitch=0&key=<?php echo $id;?>">
<img src="https://maps.googleapis.com/maps/api/streetview?location=<?php echo h($street['Street']['latitude']); ?>, <?php echo h($street['Street']['longitude']); ?>&size=456x456&heading=0&pitch=45&key=<?php echo $id;?>">
<img src="https://maps.googleapis.com/maps/api/streetview?location=<?php echo h($street['Street']['latitude']); ?>, <?php echo h($street['Street']['longitude']); ?>&size=456x456&heading=90&pitch=0&key=<?php echo $id;?>">
<img src="https://maps.googleapis.com/maps/api/streetview?location=<?php echo h($street['Street']['latitude']); ?>, <?php echo h($street['Street']['longitude']); ?>&size=456x456&heading=90&pitch=45&key=<?php echo $id;?>">
<img src="https://maps.googleapis.com/maps/api/stree
@smzn
smzn / StreetsController.php
Created Dec 11, 2019
StreetsController.php
View StreetsController.php
public function sview($id = null) {
if (!$this->Street->exists($id)) {
throw new NotFoundException(__('Invalid street'));
}
$options = array('conditions' => array('Street.' . $this->Street->primaryKey => $id));
$this->set('street', $this->Street->find('first', $options));
//StreetViewで取得した画像を保存する
$street = $this->Street->find('first', $options);
$id = "naisyo";
View gist:929f496cb62f0ddcb1ffb9c1bf9ba9d2
package rekog01;
import com.amazonaws.services.rekognition.AmazonRekognition;
import com.amazonaws.services.rekognition.AmazonRekognitionClientBuilder;
import com.amazonaws.services.rekognition.model.AmazonRekognitionException;
import com.amazonaws.services.rekognition.model.Image;
import com.amazonaws.services.rekognition.model.S3Object;
import com.amazonaws.services.rekognition.model.AgeRange;
import com.amazonaws.services.rekognition.model.Attribute;
import com.amazonaws.services.rekognition.model.DetectFacesRequest;
View Jackson
%パラメタ設定
N = 3;
P = [0 0 1; 0 0 0.6; 0.5 0 0]
lambda = [2; 1; 0]
mu = [5; 4; 6]
%[p^t-E]α = -λ
A = P.' - eye(N)
alpha = linsolve(A, -lambda)
rho = alpha ./ mu
@smzn
smzn / face
Created Jul 11, 2019
顔認識
View face
camera = webcam; % Connect to the camera
videoFrame = snapshot(camera);
% Create a cascade detector object.
faceDetector = vision.CascadeObjectDetector();
bbox = step(faceDetector, videoFrame);
% Draw the returned bounding box around the detected face.
videoFrame = insertShape(videoFrame, 'Rectangle', bbox);
figure; imshow(videoFrame); title('Detected face');
View gist:f5d5e8da71f0d8e4fc73762ce18542a9
layers = [imageInputLayer([28 28 1])
convolution2dLayer(5,20)
reluLayer
maxPooling2dLayer(2,'Stride',2)
fullyConnectedLayer(10)
softmaxLayer
classificationLayer];
View gist:cb85de7e2c89d0241803dc3a07301ed7
imds = imageDatastore('/Users/mizuno/Documents/MATLAB/deeplearning/SimpleDeepLearning/trainingSet/','IncludeSubfolders',true,'LabelSource','foldernames');
labelCount = countEachLabel(imds)
perm = randperm(40000,20);
montage(imds, 'Indices', perm);
img = readimage(imds,1);
size(img)
[imdsTrain,imdsValidation] = splitEachLabel(imds,0.8);
layers = [imageInputLayer([28 28 1])
convolution2dLayer(3,8,'Padding','same')
reluLayer
View gist:40f8b8b6a2dd951a0840b6f76022ebe6
layers = [imageInputLayer([28 28 1])
convolution2dLayer(3,8,'Padding','same')
reluLayer
maxPooling2dLayer(2,'Stride',2)
convolution2dLayer(3,16,'Padding','same')
batchNormalizationLayer
reluLayer
maxPooling2dLayer(2,'Stride',2)
You can’t perform that action at this time.