Skip to content

Commit

Permalink
change README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
IronSublimate committed Apr 4, 2021
1 parent 271de05 commit 5f372be
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
>
> Source Code: https://github.com/IronSublimate/NCNN_ObjectDetection
use Tencent's [NCNN](https://github.com/Tencent/ncnn) framework to run yolov4-tiny yolov5 and mobilenet-ssd


use Tencent's [NCNN](https://github.com/Tencent/ncnn) framework to run yolov4-tiny yolov5 and mobilenet-ssd
NCNN Verison : 20210322

## How to Build and Run
### step1
Expand Down Expand Up @@ -66,7 +65,8 @@ open this project with Android Studio, build it and enjoy!
}
```
## Known Issues
1. Might be crashed when first open this app
## Acknowledgement
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {
minSdkVersion 24
targetSdkVersion 29
versionCode 1
versionName "1.0.1"
versionName "1.0.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
ndk {
moduleName "ncnn"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ protected void onCreate(Bundle savedInstanceState) {

@Override
protected void onResume() {
super.onResume();

new Thread() {
@Override
public void run() {
Expand All @@ -122,6 +122,7 @@ public void run() {
// });
}
}.start();
super.onResume();
}

private void updateSettings() {
Expand All @@ -141,7 +142,9 @@ private void updateSettings() {
try {
NCNNDetector tempDetector = (NCNNDetector) (Class.forName(networkClassName).newInstance());
String s = detectNetwork.getOrDefault(networkClassName, "");
textViewNetwork.setText(s);
runOnUiThread(()->{
textViewNetwork.setText(s);
});
boolean ret_init = tempDetector.Init(getAssets());
if (!ret_init) {
Log.e(TAG, "NCNN Detector Init failed");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.MenuItem;
import android.view.View;
import android.widget.Switch;

import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.preference.*;
import androidx.preference.ListPreference;
import androidx.preference.PreferenceFragmentCompat;
import androidx.preference.PreferenceManager;
import androidx.preference.SwitchPreferenceCompat;

import java.util.HashMap;
import java.util.List;

public class SettingsActivity extends AppCompatActivity {
private static final String TAG = "SettingsActivity";
Expand Down Expand Up @@ -50,7 +50,9 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
listPreference.setEntries(methodMap.values().toArray(new String[0]));
listPreference.setEntryValues(methodMap.keySet().toArray(new String[0]));
// listPreference.setDefaultValue(methodMap.keySet().stream().findFirst());
listPreference.setValueIndex(0);
if (listPreference.getValue() == null) {
listPreference.setValueIndex(0);
}
}
}

Expand Down
1 change: 1 addition & 0 deletions app/src/main/jni/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ add_library(
target_link_libraries(ncnn_detector
ncnn
jnigraphics
glslang
)

0 comments on commit 5f372be

Please sign in to comment.