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
android { | |
aaptOptions { | |
noCompress "tflite" | |
noCompress "lite" | |
} | |
} | |
......... | |
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
public class MainActivity extends AppCompatActivity { | |
private Interpreter tflite; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
} | |
} |
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
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); | |
} |
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
String modelFile= "modelim.lite" | |
try { | |
tflite = new Interpreter(loadModelFile(this, modelFile)); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} |
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
float[][] out = new float[][]{{0}}; | |
tflite.run(inp, out); | |
Log.d("Sonuç", String.valueOf(Math.round(out[0][0]))); |
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
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}}; |
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
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 \ |
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
docker pull gitlab/gitlab-ce |
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
docker images |
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
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 |