visageSDK
MainActivity.java
1 package com.visagetechnologies.showcasedemo;
2 
3 import android.content.Intent;
4 import android.content.res.AssetManager;
5 import android.content.res.Configuration;
6 import android.graphics.Typeface;
7 import android.os.Bundle;
8 import android.os.Handler;
9 
10 import androidx.activity.result.ActivityResultLauncher;
11 import androidx.activity.result.contract.ActivityResultContracts;
12 import androidx.fragment.app.FragmentActivity;
13 import androidx.core.view.GravityCompat;
14 import androidx.drawerlayout.widget.DrawerLayout;
15 import androidx.appcompat.widget.SwitchCompat;
16 import android.util.Log;
17 import android.view.KeyEvent;
18 import android.view.View;
19 import android.view.ViewGroup;
20 import android.view.WindowManager;
21 import android.widget.ImageView;
22 import android.widget.LinearLayout;
23 import android.widget.ProgressBar;
24 import android.widget.TextView;
25 
26 import java.io.File;
27 import java.io.FileOutputStream;
28 import java.io.InputStream;
29 import java.io.OutputStream;
30 import java.lang.ref.WeakReference;
31 import java.util.ArrayList;
32 
33 import static java.lang.Math.min;
34 
35 public class MainActivity extends FragmentActivity
36  implements View.OnClickListener {
37 
38  private static final String TAG = "CameraSample";
39 
40  private SwitchCompat[] switchCompat;
41  private final Integer[] switchIDs = {
42  R.id.feature_points,
43  R.id.iris,
44  R.id.splines,
45  R.id.gaze_tracking,
46  R.id.axes,
47 
48  R.id.wireframe,
49 
50  R.id.age_e,
51  R.id.gender_e,
52  R.id.emotion_e,
53  };
54 
55  private final Integer[] emotionProgressIDs = {
56  R.id.anger_pb,
57  R.id.disgust_pb,
58  R.id.fear_pb,
59 
60  R.id.happiness_pb,
61  R.id.sadness_pb,
62  R.id.surprise_pb
63  };
64 
65  private final Integer[] emotionProgressTextIDs = {
66  R.id.anger_tv,
67  R.id.disgust_tv,
68  R.id.fear_tv,
69 
70  R.id.happiness_tv,
71  R.id.sadness_tv,
72  R.id.surprise_tv
73  };
74 
75  private final int[] displayValues = {
76  VisageWrapper.DISPLAY_FEATURE_POINTS,
77  VisageWrapper.DISPLAY_IRIS,
78  VisageWrapper.DISPLAY_SPLINES,
79  VisageWrapper.DISPLAY_GAZE,
80  VisageWrapper.DISPLAY_AXES,
81 
82  VisageWrapper.DISPLAY_WIRE_FRAME,
83 
84  VisageWrapper.DISPLAY_AGE,
85  VisageWrapper.DISPLAY_GENDER,
86  VisageWrapper.DISPLAY_EMOTIONS
87  };
88 
89  Integer numSwitches = switchIDs.length;
90  private TrackingFragment currentFragmentForTracking;
91  private DrawerLayout mDrawerLayout;
92  private VisageWrapper visageWrapper = null;
93 
94  private LinearLayout analyserResults;
95  private LinearLayout appBar;
96 
97  private int ACTIVE_DISPLAY = 0;
98  private final Handler mHandler = new Handler();
99 
100  boolean mediaFragmentPermissionGranted = false;
101  boolean mediaFragmentPermissionDenied = false;
102 
103  public ActivityResultLauncher<String[]> mediaFragmentPermissionLouncher;
104 
105  static {
106  System.loadLibrary("VisageWrapper");
107  }
108 
109  @Override
110  public void onCreate(Bundle savedInstanceState) {
111  super.onCreate(savedInstanceState);
112  getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
113  WindowManager.LayoutParams.FLAG_FULLSCREEN);
114 
115  visageWrapper = VisageWrapper.get(this);
116 
117  visageWrapper.AllocateResources();
118 
119  copyAssets(getFilesDir().getAbsolutePath());
120  currentFragmentForTracking = visageWrapper.isTrackingFromMedia() ? TrackingFragment.Media : TrackingFragment.Camera2;
121 
122  if (null == savedInstanceState) {
123  this.getSupportFragmentManager()
124  .beginTransaction()
125  .replace(R.id.fragment_container,
126  (currentFragmentForTracking == TrackingFragment.Camera2) ? Camera2Fragment.get() : MediaFragment.get(this))
127  .commit();
128  }
129 
130  mediaFragmentPermissionLouncher = registerForActivityResult(new ActivityResultContracts.RequestMultiplePermissions(), isGranted -> {
131  if (isGranted.get(MediaFragment.READ_PERMISSIONS[0]) // READ_EXTERNAL_STORAGE
132  || (isGranted.get(MediaFragment.READ_PERMISSIONS[1]) && isGranted.get(MediaFragment.READ_PERMISSIONS[2]))) // 33
133  {
134  mediaFragmentPermissionGranted = true;
135  return;
136  }
137 
138  Log.e(TAG, "Not enough privileges");
139  mediaFragmentPermissionDenied = true;
140  });
141 
142  initializeViews();
143  }
144 
145  private void initializeViews() {
146  setContentView(R.layout.activity_main);
147 
148  attachTrackerView();
149 
150  attachDisplaySwitches();
151  attachViewListeners();
152 
153  updateButtonsVisibility();
154 
155  initializeAnalyserDisplay();
156 
157  mDrawerLayout = findViewById(R.id.drawer_layout);
158 
159  appBar = findViewById(R.id.app_bar);
160 
161  setFontFamily(mDrawerLayout, "bariol_regular");
162  setFontFamily(mDrawerLayout, "bariol_bold");
163 
164  mDrawerLayout.addDrawerListener(new DrawerLayout.DrawerListener() {
165  @Override
166  public void onDrawerSlide(View drawerView, float slideOffset) {
167 
168  }
169 
170  @Override
171  public void onDrawerOpened(View drawerView) {
172 
173  }
174 
175  @Override
176  public void onDrawerClosed(View drawerView) {
177  int orientation = getResources().getConfiguration().orientation;
178  if (orientation == Configuration.ORIENTATION_LANDSCAPE)
179  SlideAnimationUtil.slideInFromRight(getApplicationContext(), appBar);
180  else
181  SlideAnimationUtil.slideInFromTop(getApplicationContext(), appBar);
182  }
183 
184  @Override
185  public void onDrawerStateChanged(int newState) {
186 
187  }
188  });
189  }
190 
191  @Override
192  public void onConfigurationChanged(Configuration newConfiguration) {
193  super.onConfigurationChanged(newConfiguration);
194  boolean[] switchChecked = new boolean[switchCompat.length];
195  for (int i = 0; i < switchChecked.length; i++) {
196  switchChecked[i] = switchCompat[i].isChecked();
197  }
198 
199  initializeViews();
200 
201  for (int i = 0; i < min(switchCompat.length, switchChecked.length); i++) {
202  switchCompat[i].setChecked(switchChecked[i]);
203  }
204 
205  updateTrackingDisplay();
206  updateAnalyserDisplay();
207  }
208 
209  @Override
210  public void onResume() {
211  super.onResume();
212  updateTrackingDisplay();
213  updateAnalyserDisplay();
214  }
215 
216  @Override
217  public void onPause() {
218  super.onPause();
219  }
220 
221  @Override
222  public void onDestroy() {
223  super.onDestroy();
224  visageWrapper.DeallocateResources();
225  visageWrapper.onDestroy();
226  }
227 
228  @Override
229  public void onClick(View v) {
230  int orientation = getResources().getConfiguration().orientation;
231 
232  switch (v.getId()) {
233  case R.id.openMenu:
234  if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
235  mDrawerLayout.openDrawer(GravityCompat.END);
236  SlideAnimationUtil.slideOutToRight(this, appBar);
237  } else {
238  mDrawerLayout.openDrawer(GravityCompat.START);
239  SlideAnimationUtil.slideOutToTop(this, appBar);
240  }
241  break;
242 
243  case R.id.openGallery:
244  if (!visageWrapper.isTrackingFromMedia())
245  changeFragmentForTracking();
246  else {
247  visageWrapper.onPause();
248  var mediaFragment = MediaFragment.get(this);
249 
250  getSupportFragmentManager().beginTransaction()
251  .setReorderingAllowed(false)
252  .replace(R.id.fragment_container, mediaFragment)
253  .commit();
254  }
255 
256  updateButtonsVisibility();
257  break;
258 
259  case R.id.openCamera:
260  if (visageWrapper.isTrackingFromMedia())
261  changeFragmentForTracking();
262 
263  updateButtonsVisibility();
264  break;
265 
266  case R.id.switchCamera:
267  Camera2Fragment camera2Fragment = Camera2Fragment.get();
268 
269  if (camera2Fragment != null)
270  camera2Fragment.switchCamera();
271  break;
272 
273  case R.id.feature_points:
274  case R.id.splines:
275  case R.id.gaze_tracking:
276  case R.id.axes:
277  case R.id.wireframe:
278  updateTrackingDisplay();
279  updateAnalyserDisplay();
280  break;
281  case R.id.age_e:
282  case R.id.gender_e:
283  case R.id.emotion_e:
284  initAnalysis();
285  updateTrackingDisplay();
286  updateAnalyserDisplay();
287  break;
288  case R.id.ears:
289  toggleEars();
290  break;
291  case R.id.iris:
292  toggleIris();
293  break;
294  case R.id.vnn:
295  toggleRefineLandmarks();
296  break;
297  default:
298  break;
299  }
300  }
301 
308  public void copyFile(String rootDir, String filename) {
309  AssetManager assetManager = this.getAssets();
310 
311  InputStream in = null;
312  OutputStream out = null;
313  try {
314  String newFileName = rootDir + File.separator + filename;
315  File file = new File(newFileName);
316 
317  if (!file.exists()) {
318  in = assetManager.open("trackerdata/" + filename);
319  out = new FileOutputStream(newFileName);
320 
321  byte[] buffer = new byte[4 * 1024];
322  int read;
323  while ((read = in.read(buffer)) != -1) {
324  out.write(buffer, 0, read);
325  }
326  out.flush();
327  out.close();
328  out = null;
329 
330  in.close();
331  in = null;
332  }
333  } catch (Exception e) {
334  Log.e(TAG, e.getMessage());
335  }
336  }
337 
343  public void copyAssets(String rootDir) {
344  AssetManager assetManager = this.getAssets();
345 
346  String assets[] = null;
347  try {
348  assets = assetManager.list("trackerdata");
349 
350  for (String asset : assets) {
351  Log.i(TAG, rootDir + File.separator + asset);
352  try {
353  if (!asset.contains("vfa") && !asset.contains("vfr")
354  && !asset.contains("vft")) copyFile(rootDir, asset);
355  } catch (Exception e) {
356  Log.e(TAG, e.getMessage());
357  }
358  }
359  } catch (Exception e) {
360  Log.e(TAG, e.getMessage());
361  }
362 
363  // create dirs
364  final String[] dirs = {
365  "vfa",
366  "vfa/ad",
367  "vfa/ed",
368  "vfa/gd",
369  "vfr",
370  "vft",
371  "vft/er",
372  "vft/fa",
373  "vft/ff",
374  "vft/fm",
375  "vft/pr"
376  };
377 
378  for (String dirname : dirs) {
379  try {
380  File dir = new File(rootDir + File.separator + dirname);
381  if (!dir.exists()) dir.mkdir();
382  } catch (Exception e) {
383  Log.e(TAG, e.getMessage());
384  }
385  }
386 
387  // copy files
388  final String[] files = {
389  "vfa/ad/ae.tflite",
390  "vfa/ed/ed0.lbf",
391  "vfa/ed/ed1.lbf",
392  "vfa/ed/ed2.lbf",
393  "vfa/ed/ed3.lbf",
394  "vfa/ed/ed4.lbf",
395  "vfa/ed/ed5.lbf",
396  "vfa/ed/ed6.lbf",
397  "vfa/gd/gd.tflite",
398  "vft/er/efa.lbf",
399  "vft/er/efc.lbf",
400  "vft/fa/aux_file.bin",
401  "vft/fa/d1qy.tflite",
402  "vft/fa/d2.tflite",
403  "vft/ff/ff.tflite",
404  "vft/fm/candide3.fdp",
405  "vft/fm/candide3.wfm",
406  "vft/fm/jk_300.fdp",
407  "vft/fm/jk_300.wfm",
408  "vft/fm/jk_300.cfg",
409  "vft/fm/jk_300_detector.cfg",
410  "vft/fm/jk_300_wEars.fdp",
411  "vft/fm/jk_300_wEars.wfm",
412  "vft/fm/jk_300_wEars.cfg",
413  "vft/pr/pr.tflite"
414  };
415 
416  for (String filename : files) {
417  try {
418  Log.i(TAG, rootDir + File.separator + filename);
419  copyFile(rootDir, filename);
420  } catch (Exception e) {
421  Log.e(TAG, e.getMessage());
422  }
423  }
424  }
425 
426  @Override
427  public void onActivityResult(int requestCode, int resultCode, Intent data) {
428  super.onActivityResult(requestCode, resultCode, data);
429  }
430 
431  public void changeFragmentForTracking() {
432  currentFragmentForTracking = currentFragmentForTracking == TrackingFragment.Camera2 ? TrackingFragment.Media : TrackingFragment.Camera2;
433 
434  getSupportFragmentManager().beginTransaction()
435  .setReorderingAllowed(false)
436  .replace(R.id.fragment_container,
437  currentFragmentForTracking == TrackingFragment.Camera2 ? Camera2Fragment.get() : MediaFragment.get(this))
438  .commit();
439 
440  }
441 
442  private void attachTrackerView() {
443  ViewGroup parent = findViewById(R.id.parentMain);
444  View trackerView = visageWrapper.getTrackerView();
445 
446  if (trackerView.getParent() != null)
447  ((ViewGroup) trackerView.getParent()).removeView(trackerView);
448 
449  parent.addView(trackerView, 1);
450  }
451 
452  private void attachViewListeners() {
453  findViewById(R.id.openMenu).setOnClickListener(this);
454  findViewById(R.id.openCamera).setOnClickListener(this);
455  findViewById(R.id.openGallery).setOnClickListener(this);
456  findViewById(R.id.switchCamera).setOnClickListener(this);
457 
458  ViewGroup trackerOptions = findViewById(R.id.tracker_options);
459 
460  if (trackerOptions == null)
461  return;
462 
463  for (int index = 0; index < trackerOptions.getChildCount(); ++index) {
464  TextView nextChild = (TextView) trackerOptions.getChildAt(index);
465  nextChild.setOnClickListener(this);
466  }
467  }
468 
469  private void attachDisplaySwitches() {
470  switchCompat = new SwitchCompat[numSwitches];
471 
472  for (int i = 0; i < numSwitches; i++) {
473  switchCompat[i] = findViewById(switchIDs[i]);
474  }
475 
476  }
477 
478  private void initializeAnalyserDisplay() {
479  analyserResults = findViewById(R.id.analyser_results);
480 
481  TextView ageTV = findViewById(R.id.age_tv);
482  ImageView genderIV = findViewById(R.id.gender_iv);
483  TextView genderTV = findViewById(R.id.gender_tv);
484 
485  ProgressBar[] emotionProgressBar = new ProgressBar[VisageWrapper.NUM_EMOTIONS];
486  TextView[] emotionTV = new TextView[VisageWrapper.NUM_EMOTIONS];
487 
488  TextView instructionMessageTV = findViewById(R.id.instructionM_tv);
489 
490  for (int i = 0; i < VisageWrapper.NUM_EMOTIONS; i++) {
491  emotionProgressBar[i] = findViewById(emotionProgressIDs[i]);
492  emotionTV[i] = findViewById(emotionProgressTextIDs[i]);
493  }
494 
495  mHandler.postDelayed(new DoneRunnable(ageTV, genderIV, genderTV, emotionProgressBar, emotionTV, instructionMessageTV, mHandler), 20);
496  }
497 
498  private void updateAnalyserDisplay() {
499  if (analyserResults == null)
500  return;
501 
502  int orientation = getResources().getConfiguration().orientation;
503 
504  if ((ACTIVE_DISPLAY & VisageWrapper.DISPLAY_AGE) +
505  (ACTIVE_DISPLAY & VisageWrapper.DISPLAY_GENDER) +
506  (ACTIVE_DISPLAY & VisageWrapper.DISPLAY_EMOTIONS)
507  != 0) {
508  if (analyserResults.getVisibility() == View.GONE) {
509  if (orientation == Configuration.ORIENTATION_LANDSCAPE)
510  SlideAnimationUtil.slideInFromLeft(this, analyserResults);
511  else
512  SlideAnimationUtil.slideInFromBottom(this, analyserResults);
513  }
514  } else {
515  if (analyserResults.getVisibility() == View.VISIBLE) {
516  if (orientation == Configuration.ORIENTATION_LANDSCAPE)
517  SlideAnimationUtil.slideOutToLeft(this, analyserResults);
518  else
519  SlideAnimationUtil.slideOutToBottom(this, analyserResults);
520  }
521  }
522  }
523 
524  private void toggleEars() {
525  if (visageWrapper != null)
526  {
527  visageWrapper.toggleEars();
528  }
529  }
530 
531  private void toggleIris() {
532  if (visageWrapper != null)
533  {
534  visageWrapper.toggleIris();
535  }
536  }
537 
538  private void toggleRefineLandmarks() {
539  if (visageWrapper != null)
540  {
541  if (((SwitchCompat)findViewById(R.id.vnn)).isChecked())
542  {
543  visageWrapper.toggleRefineLandmarks(true);
544  ((TextView)findViewById(R.id.vnn)).setText("High");
545  }
546  else
547  {
548  visageWrapper.toggleRefineLandmarks(false);
549  ((TextView)findViewById(R.id.vnn)).setText("Low");
550  }
551  }
552  }
553 
554  public void initAnalysis() {
555  visageWrapper.initAnalyser();
556  }
557 
558  public void updateTrackingDisplay() {
559  if (visageWrapper == null)
560  return;
561 
562  ACTIVE_DISPLAY = VisageWrapper.DISPLAY_POINT_QUALITY; //these options are always enabled
563  for (int i = 0; i < switchCompat.length; i++) {
564  if (switchCompat[i] == null)
565  continue;
566  if (switchCompat[i].isChecked())
567  ACTIVE_DISPLAY += displayValues[i];
568  }
569 
570  visageWrapper.
571  SetDisplayOptions(ACTIVE_DISPLAY);
572  }
573 
574  void updateButtonsVisibility() {
575  if (currentFragmentForTracking == TrackingFragment.Camera2) {
576 
577  findViewById(R.id.switchCamera).setVisibility(View.VISIBLE);
578  findViewById(R.id.openCamera).setVisibility(View.GONE);
579  } else {
580 
581  findViewById(R.id.switchCamera).setVisibility(View.GONE);
582  findViewById(R.id.openCamera).setVisibility(View.VISIBLE);
583  }
584  }
585 
586  private enum TrackingFragment {
587  Media,
588  Camera2
589  }
590 
591  private static final class DoneRunnable implements Runnable {
592  private final WeakReference<TextView> mAgeTV;
593  private final WeakReference<ImageView> mGenderIV;
594  private final WeakReference<TextView> mGenderTV;
595 
596  private final WeakReference[] mEmotionPB = new WeakReference[VisageWrapper.NUM_EMOTIONS];
597  private final WeakReference[] mEmotionTV = new WeakReference[VisageWrapper.NUM_EMOTIONS];
598  private final WeakReference<TextView> mInstructionMesssage;
599  private final WeakReference<Handler> mHandlerRef;
600 
601  private float age;
602  private int gender;
603  private float[] emotions;
604  private boolean showInstructionMessage;
605 
606  DoneRunnable(TextView ageTV, ImageView genderIV, TextView genderTV, ProgressBar[] emotionPB, TextView[] emotionsTV, TextView instructionMessageTV, Handler handler) {
607 
608  mAgeTV = new WeakReference<>(ageTV);
609  mGenderIV = new WeakReference<>(genderIV);
610  mGenderTV = new WeakReference<>(genderTV);
611 
612  for (int i = 0; i < VisageWrapper.NUM_EMOTIONS; i++) {
613  mEmotionPB[i] = new WeakReference<>(emotionPB[i]);
614  mEmotionTV[i] = new WeakReference<>(emotionsTV[i]);
615  }
616 
617  mInstructionMesssage = new WeakReference<>(instructionMessageTV);
618 
619  mHandlerRef = new WeakReference<>(handler);
620  }
621 
622  @Override
623  public void run() {
624  final TextView ageTV = mAgeTV.get();
625 
626  if (ageTV != null) {
627  age = VisageWrapper.GetAge();
628 
629  if (age == -1) {
630  ageTV.setText(" - ");
631  } else {
632  ageTV.setVisibility(View.VISIBLE);
633  ageTV.setText(String.valueOf(Math.round(age)));
634  }
635  }
636 
637  final ImageView genderIV = mGenderIV.get();
638  final TextView genderTV = mGenderTV.get();
639 
640  if (genderIV != null && genderTV != null) {
641  gender = VisageWrapper.GetGender();
642 
643  if (gender == -1) {
644  genderIV.setVisibility(View.GONE);
645  genderTV.setVisibility(View.VISIBLE);
646 
647  } else if (gender == 0) {
648  genderIV.setImageResource(R.drawable.female);
649  genderIV.setVisibility(View.VISIBLE);
650  genderTV.setVisibility(View.INVISIBLE);
651  } else {
652  genderIV.setImageResource(R.drawable.male);
653  genderIV.setVisibility(View.VISIBLE);
654  genderTV.setVisibility(View.INVISIBLE);
655 
656  }
657  }
658 
659  emotions = VisageWrapper.GetEmotions();
660  final ProgressBar[] emotionPB = new ProgressBar[VisageWrapper.NUM_EMOTIONS];
661  final TextView[] emotionTV = new TextView[VisageWrapper.NUM_EMOTIONS];
662 
663  for (int i = 0; i < VisageWrapper.NUM_EMOTIONS; i++) {
664 
665  emotionPB[i] = (ProgressBar) mEmotionPB[i].get();
666  emotionTV[i] = (TextView) mEmotionTV[i].get();
667 
668  if (emotionPB[i] != null) {
669 
670  if (emotions[i] == -1) {
671  emotionPB[i].setVisibility(View.INVISIBLE);
672  } else {
673  emotionPB[i].setVisibility(View.VISIBLE);
674  emotionPB[i].setProgress(Math.round(emotions[i] * 100));
675  }
676  }
677 
678 
679  if (emotionTV[i] != null) {
680  String display = Math.round(emotions[i] * 100) + " %";
681 
682  if (emotions[i] == -1) {
683  emotionTV[i].setText(" - ");
684  } else {
685  emotionTV[i].setVisibility(View.VISIBLE);
686  emotionTV[i].setText(display);
687  }
688  }
689  }
690 
691  final TextView instructionMessageTV = mInstructionMesssage.get();
692 
693  if (instructionMessageTV != null) {
694  showInstructionMessage = VisageWrapper.ShowInstruction();
695 
696  if (showInstructionMessage) {
697  instructionMessageTV.setVisibility(View.VISIBLE);
698  } else {
699  instructionMessageTV.setVisibility(View.INVISIBLE);
700  }
701  }
702 
703  final Handler handler = mHandlerRef.get();
704  if (handler != null)
705  handler.postDelayed(this, 20);
706  }
707  }
708 
709  public boolean onKeyDown(int keycode, KeyEvent event) {
710  if (keycode == KeyEvent.KEYCODE_BACK) {
711  moveTaskToBack(true);
712  }
713  return super.onKeyDown(keycode, event);
714  }
715 
716  private void setFontFamily(ViewGroup viewGroup, String fontName) {
717  ArrayList<View> textViews = getViewsByTag(viewGroup, fontName);
718 
719  Typeface m_typeFace = Typeface.createFromAsset(getAssets(), "fonts/" + fontName + ".otf");
720 
721  for (View view : textViews) {
722  if (view instanceof TextView) {
723  TextView textView = (TextView) view;
724  textView.setTypeface(m_typeFace);
725  }
726  }
727 
728  }
729 
730  private static ArrayList<View> getViewsByTag(ViewGroup root, String tag) {
731  ArrayList<View> views = new ArrayList<View>();
732  final int childCount = root.getChildCount();
733  for (int i = 0; i < childCount; i++) {
734  final View child = root.getChildAt(i);
735  if (child instanceof ViewGroup) {
736  views.addAll(getViewsByTag((ViewGroup) child, tag));
737  }
738 
739  final Object tagObj = child.getTag();
740  if (tagObj != null && tagObj.equals(tag)) {
741  views.add(child);
742  }
743 
744  }
745  return views;
746  }
747 }