Skip to content

Instantly share code, notes, and snippets.

View hsmnzaydn's full-sized avatar
🎈
Working from home

Hüseyin Serkan Özaydin hsmnzaydn

🎈
Working from home
View GitHub Profile
android {
aaptOptions {
noCompress "tflite"
noCompress "lite"
}
}
.........
public class MainActivity extends AppCompatActivity {
private Interpreter tflite;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
private MappedByteBuffer loadModelFile(Activity activity, String MODEL_FILE) throws IOException {
AssetFileDescriptor fileDescriptor = activity.getAssets().openFd(MODEL_FILE);
FileInputStream inputStream = new FileInputStream(fileDescriptor.getFileDescriptor());
FileChannel fileChannel = inputStream.getChannel();
long startOffset = fileDescriptor.getStartOffset();
long declaredLength = fileDescriptor.getDeclaredLength();
return fileChannel.map(FileChannel.MapMode.READ_ONLY, startOffset, declaredLength);
}
String modelFile= "modelim.lite"
try {
tflite = new Interpreter(loadModelFile(this, modelFile));
} catch (IOException e) {
e.printStackTrace();
}
float[][] out = new float[][]{{0}};
tflite.run(inp, out);
Log.d("Sonuç", String.valueOf(Math.round(out[0][0])));
float n1 = 1;
float n2 = 89;
float n3 = 66;
float n4 = 23;
float n5 = 94;
float n6 = 28.1f;
float n7 = 0.167f;
float n8 = 21;
float[][] inp = new float[][]{{n1, n2, n3, n4, n5, n6, n7, n8}};
1 - sudo apt-get update
2 - sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg2 \
software-properties-common
3 - curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
4 - sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/debian \
docker pull gitlab/gitlab-ce
sudo docker run \
--hostname localhost \ --> "localhost" yerine sunucu adresinizi yazın
--publish 443:443 --publish 80:80 --publish 20:20 \ --> "80:80" gitlab'ın çalışacağı portu belirliyoruz
--name gitlab \
--restart always \ --> Eğer gitlab durursa otomatik kendiliğinden yeniden açılsın diye kullanılıyor
--volume /srv/gitlab/config:/etc/gitlab \
--volume /srv/gitlab/logs:/var/log/gitlab \
--volume /srv/gitlab/data:/var/opt/gitlab \ --> Tüm voluma işlemleri docker imajını kapatsanız bile tekrar açtığınızda verileri kaybetmeyin diye var
gitlab/gitlab-ce:latest