Skip to content

Commit

Permalink
sarker: redesign and update ML model
Browse files Browse the repository at this point in the history
  • Loading branch information
sarkerrabi committed Jan 19, 2020
1 parent 2a508a0 commit 3c7b377
Show file tree
Hide file tree
Showing 21 changed files with 58 additions and 57 deletions.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import lab.tnr.malariaditection.tflite.Classifier
class MainActivity : AppCompatActivity(), View.OnClickListener {

private val mInputSize = 32
private val mModelPath = "tf_lite_model.tflite"
private val mModelPath = "converted_autoencoder_final_result_32.tflite"
private val mLabelPath = "myLable.txt"
private lateinit var classifier: Classifier

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,27 @@
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeWidth="1"
android:strokeColor="#00000000">
android:viewportWidth="137.0505"
android:viewportHeight="137.0505">
<group
android:translateX="36.525253"
android:translateY="36.525253">
<path android:pathData="m55.326,46.578 l1.812,0.845c-2.639,5.662 -7.846,9.823 -13.928,11.131l-0.421,-1.955c5.475,-1.178 10.161,-4.924 12.537,-10.021zM56.053,44.766 L57.947,45.409c0.244,-0.717 0.448,-1.457 0.607,-2.198l-1.955,-0.42c-0.144,0.666 -0.328,1.33 -0.546,1.975zM58.121,24.231c3.146,4.148 4.879,9.3 4.879,14.506v0.263c0,13.233 -10.766,24 -24,24 -6.087,0 -11.947,-2.338 -16.37,-6.462 -1.1,3.73 -4.549,6.462 -8.63,6.462 -4.962,0 -9,-4.038 -9,-9v-27h-1c-1.654,0 -3,-1.346 -3,-3v-2c0,-1.654 1.346,-3 3,-3h1v-5c0,-1.654 1.346,-3 3,-3h12c1.654,0 3,1.346 3,3v5h0.848l12.751,-16.808c0.567,-0.746 1.464,-1.192 2.401,-1.192s1.834,0.446 2.401,1.192zM7,19h14v-5c0,-0.551 -0.449,-1 -1,-1h-1v4h-2v-4h-2v4h-2v-4h-2v4h-2v-4h-1c-0.551,0 -1,0.449 -1,1zM4,25h20c0.551,0 1,-0.449 1,-1v-2c0,-0.551 -0.449,-1 -1,-1h-20c-0.551,0 -1,0.449 -1,1v2c0,0.551 0.449,1 1,1zM21,48.976c-0.069,-0.374 -1.464,-1.976 -4,-1.976 -1.341,0 -2.967,0.739 -4.659,2.104 1.57,1.017 3.159,1.896 4.659,1.896 2.536,0 3.931,-1.602 4,-2.019zM7,27v19.131c1.169,0.282 2.364,1 3.603,1.818 1.68,-1.449 3.999,-2.949 6.397,-2.949 1.582,0 2.961,0.496 4,1.185v-3.185h-4v-2h4v-2h-6v-2h6v-2h-4v-2h4v-2h-6v-2h6v-2zM21,54v-2.185c-1.039,0.689 -2.418,1.185 -4,1.185 -2.448,0 -4.778,-1.561 -6.833,-2.938 -1.143,-0.765 -2.236,-1.494 -3.167,-1.843v5.781c0,3.86 3.14,7 7,7s7,-3.14 7,-7zM61,38.737c0,-4.772 -1.588,-9.494 -4.473,-13.296l-16.719,-22.04c-0.381,-0.503 -1.234,-0.503 -1.615,0l-12.336,16.26c0.691,0.551 1.143,1.389 1.143,2.339v2c0,1.654 -1.346,3 -3,3h-1v27c0,0.029 -0.004,0.056 -0.004,0.085 4.147,4.397 9.953,6.915 16.004,6.915 12.131,0 22,-9.869 22,-22zM34.991,53c-0.011,-0.451 0.223,-1.542 1.345,-2.664l-1.414,-1.414c-1.132,1.132 -1.597,2.252 -1.788,2.992 -0.283,1.101 -0.142,2.035 0.387,2.563 0.431,0.432 1.062,0.523 1.515,0.523 1.329,0 2.84,-0.718 4.042,-1.922l-1.414,-1.414c-1.012,1.012 -2.137,1.339 -2.673,1.336zM41.907,55.907c-2.022,2.022 -4.569,3.081 -6.879,3.081 -1.663,0 -3.202,-0.548 -4.334,-1.681 -2.706,-2.706 -2.078,-7.736 1.4,-11.213s8.509,-4.106 11.213,-1.4c2.705,2.705 2.077,7.735 -1.4,11.213zM41.893,46.107c-0.754,-0.754 -1.79,-1.117 -2.933,-1.117 -1.776,0 -3.811,0.875 -5.453,2.517 -2.698,2.698 -3.326,6.459 -1.4,8.385s5.687,1.297 8.385,-1.4 3.326,-6.459 1.401,-8.385zM36.866,34.914c-0.19,-0.74 -0.655,-1.86 -1.788,-2.992l-1.414,1.414c1.122,1.122 1.356,2.212 1.345,2.664 -0.564,0 -1.662,-0.324 -2.673,-1.335l-1.414,1.414c1.203,1.203 2.714,1.921 4.043,1.921 0.453,0 1.083,-0.091 1.513,-0.522 0.529,-0.529 0.67,-1.463 0.388,-2.564zM34.972,41.987c-2.31,0 -4.857,-1.059 -6.879,-3.081 -3.478,-3.478 -4.105,-8.508 -1.4,-11.213 2.704,-2.707 7.735,-2.078 11.213,1.4s4.105,8.508 1.4,11.213c-1.132,1.133 -2.671,1.681 -4.334,1.681zM29.507,37.493c2.698,2.697 6.458,3.325 8.385,1.4 1.926,-1.926 1.298,-5.688 -1.4,-8.385 -1.642,-1.641 -3.677,-2.517 -5.453,-2.517 -1.143,0 -2.178,0.363 -2.933,1.117 -1.924,1.925 -1.296,5.687 1.401,8.385zM47.521,40.477c0.431,0.432 1.062,0.523 1.515,0.523 1.329,0 2.84,-0.718 4.042,-1.922l-1.414,-1.414c-1.011,1.012 -2.131,1.333 -2.673,1.335 -0.011,-0.451 0.223,-1.542 1.345,-2.664l-1.414,-1.414c-1.132,1.132 -1.597,2.252 -1.788,2.992 -0.282,1.102 -0.141,2.036 0.387,2.564zM57.307,30.693c2.706,2.706 2.078,7.736 -1.4,11.213 -2.022,2.022 -4.569,3.081 -6.879,3.081 -1.663,0 -3.202,-0.548 -4.334,-1.681 -2.706,-2.706 -2.078,-7.736 1.4,-11.213 3.476,-3.477 8.508,-4.106 11.213,-1.4zM52.96,30.991c-1.776,0 -3.811,0.875 -5.453,2.517 -2.698,2.698 -3.326,6.459 -1.4,8.385 1.925,1.927 5.688,1.298 8.385,-1.4 2.698,-2.698 3.326,-6.459 1.4,-8.385 -0.753,-0.754 -1.789,-1.117 -2.932,-1.117zM31,18c0,-2.757 1.794,-5 4,-5s4,2.243 4,5 -1.794,5 -4,5 -4,-2.243 -4,-5zM33,18c0,1.626 0.916,3 2,3s2,-1.374 2,-3 -0.916,-3 -2,-3 -2,1.374 -2,3zM41,23c0,-2.757 1.794,-5 4,-5s4,2.243 4,5 -1.794,5 -4,5 -4,-2.243 -4,-5zM43,23c0,1.626 0.916,3 2,3s2,-1.374 2,-3 -0.916,-3 -2,-3 -2,1.374 -2,3z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:endX="32"
android:endY="1"
android:startX="32"
android:startY="63"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
android:color="#FF9F2FFF"
android:offset="0" />
<item
android:color="#00000000"
android:offset="1.0" />
android:color="#FF0BB1D3"
android:offset="1" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</group>
</vector>
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/colorPrimaryDark"/>
<corners android:radius="@dimen/_15sdp"/>

<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="90"
android:endColor="#FF5C258D"
android:startColor="#FF4389A2"
android:type="linear" />
<corners android:radius="@dimen/_5sdp" />
</shape>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 27 additions & 28 deletions Malaria-Ditection-App/app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,57 +5,56 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity" >
android:gravity="center"
android:padding="@dimen/_5sdp"
tools:context=".MainActivity">


<TextView
android:id="@+id/tvChooseImg"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/_20sdp"
android:layout_marginTop="@dimen/_20sdp"
android:layout_marginRight="@dimen/_20sdp"
android:layout_marginBottom="@dimen/_20sdp"
android:background="@drawable/choose_image_bg"
android:gravity="center"
android:padding="@dimen/_10sdp"
android:text="Choose Image"
android:textColor="@android:color/white"
android:text="RESULT:"
android:textColor="@android:color/background_dark"
android:textSize="@dimen/_18ssp" />

<ImageView
android:id="@+id/ivChooseImage"
android:layout_width="match_parent"
android:layout_height="@dimen/_190sdp"
android:layout_marginStart="@dimen/_10sdp"
android:layout_marginTop="@dimen/_30sdp"
android:layout_marginEnd="@dimen/_10sdp"
android:layout_marginBottom="@dimen/_10sdp"
app:srcCompat="@drawable/ic_blood" />

<TextView
android:id="@+id/tvResultMessage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/_20sdp"
android:layout_marginTop="@dimen/_20sdp"
android:layout_marginRight="@dimen/_20sdp"
android:layout_marginBottom="@dimen/_20sdp"
android:gravity="center"
android:padding="@dimen/_10sdp"
android:text="RESULT:"
android:text="N/A"
android:textColor="@android:color/background_dark"
android:textSize="@dimen/_18ssp" />
android:textSize="@dimen/_18ssp"
android:textStyle="bold" />

<ImageView
android:id="@+id/ivChooseImage"
android:layout_width="match_parent"
android:layout_height="@dimen/_190sdp"
android:layout_marginStart="@dimen/_10sdp"
android:layout_marginTop="@dimen/_30sdp"
android:layout_marginEnd="@dimen/_10sdp"
android:layout_marginBottom="@dimen/_30sdp"
app:srcCompat="@drawable/picture" />


<TextView
android:id="@+id/tvResultMessage"
android:id="@+id/tvChooseImg"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/_20sdp"
android:layout_marginRight="@dimen/_20sdp"
android:layout_marginBottom="@dimen/_20sdp"
android:background="@drawable/choose_image_bg"
android:gravity="center"
android:padding="@dimen/_10sdp"
android:text="Message"
android:textColor="@android:color/background_dark"
android:textSize="@dimen/_18ssp" />

android:padding="@dimen/_5sdp"
android:text="CHOOSE IMAGE"
android:textColor="@android:color/white"
android:textSize="@dimen/_12ssp" />
</LinearLayout>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<background android:drawable="@color/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<background android:drawable="@color/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
Binary file modified Malaria-Ditection-App/app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Malaria-Ditection-App/app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#FFFFFF</color>
</resources>
2 changes: 1 addition & 1 deletion Malaria-Ditection-App/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">Malaria Ditection</string>
<string name="app_name">Malaria Detection</string>
</resources>

0 comments on commit 3c7b377

Please sign in to comment.