Skip to content

Instantly share code, notes, and snippets.

View universax's full-sized avatar

Yohei Kajiwara universax

  • PARTY inc.
  • Tokyo, Japan
View GitHub Profile
FString AFDVActor::GetSequenceFilePath()
{
FString output = "";
FString AppName = FApp::GetProjectName();
// Content Dir path
FString ContentDir = FPaths::ProjectContentDir();
UE_LOG(LogTemp, Log, TEXT("TAG: Content: %s"), *ContentDir);
// Target path
TArray<FString> tmpParsed;
TArray<FString> GetAllFilesInDirectory(const FString directory, const bool fullPath, const bool withoutExtention, const FString onlyFilesStartingWith, const FString onlyFilesWithExtension)
{
// Get all files in directory
TArray<FString> directoriesToSkip;
IPlatformFile& PlatformFile = FPlatformFileManager::Get().GetPlatformFile();
FLocalTimestampDirectoryVisitor Visitor(PlatformFile, directoriesToSkip, directoriesToSkip, false);
PlatformFile.IterateDirectory(*directory, Visitor);
TArray<FString> files;
for (TMap<FString, FDateTime>::TIterator TimestampIt(Visitor.FileTimes); TimestampIt; ++TimestampIt)
{
@universax
universax / azure_kinect_write_to_file.cpp
Created March 23, 2020 06:57
azure kinectのデプスをCVdeファイルに書き出すメモ
// Write to file
std::string rec_filename = "C:/Users/unive/Develop/kinect_data/depth/depth_" + std::to_string(framecount) + ".png";
cv::imwrite(rec_filename, depth_mat, std::vector<int>(0));
framecount++;
printf("frame: %d\n", framecount);
//---------------------------------
// OSC
//---------------------------------
#include "OscReceivedElements.h"
#include "OscPacketListener.h"
#include "OscOutboundPacketStream.h"
#include "UdpSocket.h"
#include "IpEndpointName.h"
void sendOSCMessage(int id, float x, float y, float z)
@universax
universax / ViewController.m
Created June 16, 2019 01:40
MobileVLCFrameworkのシンプルなテストコード
//
// ViewController.m
// VLC_Test
//
// Created by YOHEI KAJIWARA on 2019/06/15.
// Copyright © 2019 YOHEI KAJIWARA. All rights reserved.
//
#import "ViewController.h"
#import "MobileVLCKit/MobileVLCKit.h"
#UINT8
tflite_convert \
--output_file="/home/user_name/output/mobilenet_v1_mymodel_frozen.tflite" \
--graph_def_file="/home/user_name/output/mobilenet_v1_mymodel_frozen.pb" \
--input_arrays=input \
--output_arrays=MobilenetV1/Predictions/Reshape_1 \
--default_ranges_min=0 \
--default_ranges_max=255 \
--inference_type=QUANTIZED_UINT8 \
--mean_values=128 \
freeze_graph \
--input_graph="/home/user_name/output/mobilenet_v1_mymodel.pb" \
--input_binary=true \
--input_checkpoint="/home/user_name/train/model.ckpt-1000" \
--output_graph="/home/user_name/output/mobilenet_v1_mymodel_frozen.pb" \
--output_node_names=MobilenetV1/Predictions/Reshape_1
python export_inference_graph.py \
--alsologtostderr \
--model_name=mobilenet_v1 \
--output_file="/home/user_name/output/mobilenet_v1_mymodel.pb" \
--dataset_name=mymodel
@universax
universax / mobilenetV1_train.sh
Last active February 14, 2019 02:40
Transfer learning from pre trained model
# tensorflow/models/research/slim
# datasets needs to be converted to tfrecord format.
python train_image_classifier.py \
--train_dir "/home/user_name/train" \
--dataset_dir "/home/user_name/dataset" \
--model_name "mobilenet_v1" \
--dataset_name=mymodel \
--dataset_split_name=train \
--checkpoint_path "/home/user_name/mobilenet/mobilenet_v1_1.0_224.ckpt" \
--train_image_size=224 \
find . -name '.DS_Store' -type f -ls -delete