CN | EN

Developer Center

Home-Developer Center-Documentation

Dish Recognition SDK (Standalone Offline Edition) API Reference

Version: v1.0.0 | Build date: 2026-11-13 | Architecture: arm64-v8a (RK3566 / RK3576 / RK3588 and other RKNN platforms)
Artifact: sdk-release.aar (built-in YOLO detection model + CLIP image model + object tracking + offline activation-code gating)

This release is a pure offline standalone edition: it contains no gateway authentication, WebSocket, HTTP communication, cloud training submission, online model/feature download, version rollback or online AI matting. All inference, category features, samples and license state are kept on the device and work with the network disconnected.

1. Overview

This SDK packages the core inference capabilities of the original Android project as an AAR library for direct integration by third-party apps. Capabilities:

CapabilityDescription
YOLO object detectionRKNN (NPU) inference returning boxes, classes and confidence; model best.rknn is bundled
CLIP image classificationOn-device CLIP model extracts normalized features from the detection crop and compares them with the local category library; model clip_vision_finetuned.rknn is bundled
Object trackingMulti-object tracking (track id) to stabilize detections
Category / exclusion managementPositive categories and exclusions (negative samples) persisted locally (bin + json)
Offline activation gatingActivation state persisted locally; when not activated the models refuse to initialize and inference is blocked

1.1 Package structure (com.rockchip.gpadc.demo)

com.rockchip.gpadc.demo
├── ClipHelper                    # High-level CLIP recognition wrapper (recommended entry)
├── ClipHelper$Result             # Recognition result {clsName, score, isNegative}
├── clip.ClipInferenceWrapper     # Low-level CLIP RKNN image/text model wrapper
├── yolo.InferenceWrapper         # YOLO RKNN detection wrapper (singleton)
├── yolo.PostProcess              # Detection post-processing / label loading
├── tracker.ObjectTracker         # Multi-object tracking
├── InferenceResult               # Inference result container (OutputBuffer / Recognition / DetectResultGroup)
├── DetectionResult               # Parcelable detection result (cross-process)
├── ImageBufferQueue              # NPU image buffer queue
├── rga.RGA                       # RGA hardware-accelerated color conversion
├── rga.HALDefine                 # Format and resolution constants
└── license.LicenseManager         # Offline activation state management and gating
Note: the whole licensing loop lives inside the SDK — device identifier generation, local activation-code verification (device-bound MD5 digest, start/end validity window, clock rollback protection), activation state persistence and inference gating are all provided by LicenseManager. It never accesses the network and integrators do not need to implement the verification algorithm themselves.

1.2 Bundled models and assets (assets/)

FileTypeSizeDescription
clip_vision_finetuned.rknnCLIP image model~175 MB512-dim normalized image feature extraction
best.rknnYOLO detection model~10 MBNPU object detection (single class: food)
text_features.binCLIP text features~6 KBPrecomputed category text features (used by default, no on-device text model needed)
categories.jsonCategory mapping<1 KBInitial category mapping
coco_80_labels_list.txtLabels<1 KBYOLO class labels
tokenizer/merges.txt, tokenizer/vocab.jsonVocabulary~1.3 MBCLIP text tokenizer

1.3 Native libraries (jni/arm64-v8a/)

.so fileSizeDescription
librknn4j.so~66 KBJNI core of this SDK, compiled from C++ sources with CMake
librknnrt.so~7.6 MBRKNN Runtime
librga.so~1.1 MBRGA hardware 2D acceleration
libopencv_java3.so~17.1 MBOpenCV
Packing the two models plus the native libraries yields an AAR of about 169 MB, so the host app does not need to download or store model files separately.

2. Integration

2.1 Adding the AAR

Copy sdk-release.aar into the host project's app/libs/ directory and add the following to app/build.gradle:

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
    // The SDK exposes Gson through api (category/feature file IO), so do not add it again
    implementation 'com.google.code.gson:gson:2.10.1'
}
This SDK does not depend on OkHttp, Socket.IO or any other network library; do not leave network dependencies from the old online edition in the host app.

2.2 Permissions

The AAR's AndroidManifest.xml declares the following permissions, which are merged automatically (no INTERNET, ACCESS_NETWORK_STATE):

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" tools:ignore="ScopedStorage" />

The host must still request the camera permission at runtime (Android 6.0+):

if (checkSelfPermission(Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {
    requestPermissions(new String[]{Manifest.permission.CAMERA}, 1);
}

2.3 Hardware and system requirements

  • An RKNN-capable arm64-v8a device (RK3566 / RK3576 / RK3588 etc.) with the NPU driver available; ordinary emulators have no NPU and cannot run inference.
  • minSdk 25, targetSdk 33, compileSdk 33, Java 8 compatible.

3. Activation Code License (LicenseManager)

Prerequisite: local activation must be completed before calling inference APIs. When not activated, ClipHelper.initVisionModel() returns false, and InferenceWrapper.initModel()/initModelFromAssets() throw LicenseNotActivatedException.

Package: com.rockchip.gpadc.demo.license.LicenseManager

3.1 How the licensing loop works

  • SDK (LicenseManager): generates/reads the device identifier, verifies the activation code locally (device binding, MD5 digest, validity window, rollback protection), writes the activation state and gates the inference entry points. Everything is stored in the device's SharedPreferences; no network access.
  • Host app: shows the activation page, collects the user-entered code and calls verifyAndActivate(...) to verify and activate. You do not need to implement the MD5 / validity / rollback algorithms yourself.
  • Gating: when not activated, CLIP initVisionModel() returns false and YOLO initModelFromAssets() / initModel() throw LicenseNotActivatedException; models are not loaded.

3.2 Core APIs

Package: com.rockchip.gpadc.demo.license.LicenseManager

MethodDescription
static String getDeviceId(Context ctx)Returns the unique device identifier. It reuses a locally persisted ID first; otherwise it takes the Android ID (generating a UUID when unavailable or when it is the emulator default), appends a 3-character random uppercase suffix in the form android_<androidId><XXX> and persists it.
static boolean isActivated(Context ctx)Synchronously reads the local activation state (no network).
static String getActivationCode(Context ctx)Returns the locally saved activation code, or an empty string when not activated.
static String getExpireTime(Context ctx)Returns the expiry display string; empty means permanent (display only).
static boolean verifyOffline(Context ctx, String code, StringBuilder errMsg)Verifies the activation code locally without writing state. Returns true on success; the reason/message is written to errMsg.
static void verifyAndActivate(Context ctx, String code, LicenseCallback cb)Recommended entry: calls verifyOffline first, then writes the activation state and updates the rollback record on success; failures invoke onFailure, success invokes onSuccess.
static void activateOffline(Context ctx, String code, String expireTime, LicenseCallback cb)Low-level state write without validating the code. Use only when the host has already validated it; prefer verifyAndActivate in normal scenarios.
static boolean checkTimeRollback(Context ctx)Checks whether the system clock has been rolled back into an invalidated interval (5-minute tolerance).
static void recordMaxWallIfValid(Context ctx)Updates the historical maximum wall-clock time when the current time is valid and not expired; call it in onResume or a scheduled task.
static String decodeActivationSpan(Context ctx, String code)Parses and returns the start/end time, valid days and current status as a display string; returns null for an invalid format.
static void assertActivated(Context ctx)Gating check: throws LicenseNotActivatedException when not activated. The SDK calls it automatically during model initialization, so hosts normally need not call it explicitly.
static void resetDevice(Context ctx)Clears the activation code, rollback record and persisted device ID (the UNLOCK- reset flow) and regenerates the device identifier afterwards.
static void clearActivation(Context ctx)Clears the local activation state while keeping the device ID (for code replacement / sign-out).

Callback interface:

LicenseManager.LicenseCallback cb = new LicenseManager.LicenseCallback() {
    @Override public void onSuccess(String msg) { /* Activated, go to the home screen */ }
    @Override public void onFailure(String errMsg) { /* Show the error message */ }
};

Exception class: LicenseManager.LicenseNotActivatedException extends IllegalStateException, thrown by the inference entry points when not activated; the host can catch it and redirect to the activation page.

3.3 Activation code structure and rules

24-character hexadecimal activation code (after removing hyphens/spaces and lowercasing):

PositionContent
Chars 1–16Verification digest: first 16 characters of MD5(last 5 chars of device ID + start date hex + end date hex)
Chars 17–20Activation start date (hex day number, starting at 00:00 Beijing time)
Chars 21–24End date (hex day number, through 23:59:59 of that day)
  • Device binding: the digest is valid only for the bound device; the same code fails verification on a different device.
  • Validity window: if the current time is earlier than the start date the window has not started; if later than the end date the code has expired.
  • Rollback protection: the maximum historical system time is recorded; if that time is already past the end date, the code is treated as void, preventing bypassing the window by clock rollback.
  • Reset code (UNLOCK- prefix): in this project it is used to clear activation records and reset the device identifier (resetDevice); it is not a code that grants access directly.
The above verification is performed inside the SDK. If you generate valid activation codes on the issuing side, the digest algorithm, time zone (UTC+8) and device identifier rules must match this section.

3.4 Minimal integration example

import com.rockchip.gpadc.demo.license.LicenseManager;
import com.rockchip.gpadc.demo.license.LicenseManager.LicenseCallback;

// 1) Already activated? Use it directly
if (LicenseManager.isActivated(this)) {
    goToMainPage();
} else {
    // 2) Show the activation page; the SDK verifies and persists the entered code locally
    LicenseManager.verifyAndActivate(this, editTextCode.getText().toString().trim(),
            new LicenseCallback() {
                @Override public void onSuccess(String msg) { goToMainPage(); }
                @Override public void onFailure(String err) {
                    Toast.makeText(MainActivity.this, err, Toast.LENGTH_LONG).show();
                }
            });
}

// 3) Initialize inference after entering the home screen (gating now passes)
ClipHelper clip = ClipHelper.getInstance(this);
InferenceWrapper.getInstance().initModelFromAssets(this, 640, 640, 3);

Add one rollback-record refresh in onResume or a scheduled task:

LicenseManager.recordMaxWallIfValid(this);

3.5 FAQ

SymptomCauseResolution
LicenseNotActivatedExceptionInference initialized/called before activationCall verifyAndActivate to complete local activation first
"Device mismatch or tampered"Last 5 characters of the device ID do not match the digest, or the code was modifiedCheck that the device ID and activation code correspond
"Activation window not started / expired"Current time is outside the start/end windowCheck the date segment of the code and the device system time
"Void (historical time exceeded)"The rollback record shows the end date was exceeded beforeContact the issuer for a new code, or use the reset flow
getDeviceId changesresetDevice was executed, or the device was replaced / factory resetIssue a new activation code for the new device

4. CLIP Recognition (ClipHelper)

Prerequisite: activation completed (see section 3). When not activated, initVisionModel() returns false and isReady() is false.

CLIP recognition is image classification: given a Bitmap cropped from a detection box, it returns the best-matching category in the local category library.

4.1 Initialization (singleton)

import com.rockchip.gpadc.demo.ClipHelper;

ClipHelper clipHelper = ClipHelper.getInstance(context);
// Internally: copies clip_vision_finetuned.rknn to the cache and loads text_features.bin / categories.json
boolean ready = clipHelper.isReady();
MethodDescription
static ClipHelper getInstance(Context context)Returns the global singleton; the first call runs initVisionModel() and is slow (model loading).
static void resetInstance()Resets the singleton and clears static caches (categories, exclusions, stability cache).
boolean initVisionModel()Initializes the vision model; returns false when not activated.
boolean isReady()Whether the model is ready.
boolean reloadModels() / void reloadFeatures()Reload models / feature cache.

4.2 Image feature extraction

float[] feature = clipHelper.extractImageFeature(bitmap); // Returns a 512-dim normalized feature, or null on failure

4.3 Classification (core API)

// Simple classification
ClipHelper.Result r = clipHelper.clipClassify(cropBitmap);

// With position (pass the normalized target box for position filtering)
ClipHelper.Result r = clipHelper.clipClassify(cropBitmap, rectF);

// With trackId (enables stabilization: output only after consistent results across frames)
ClipHelper.Result r = clipHelper.clipClassify(cropBitmap, rectF, trackId);

ClipHelper.Result:

FieldTypeDescription
clsNameStringCategory name; null means an exclusion matched; "ignore" means below threshold; "failed" means failure
scorefloatSimilarity score (0–1, normalized cosine similarity)
isNegativebooleantrue = the result should be ignored (exclusion / below threshold); the UI should filter it and draw no box

4.4 Category / exclusion management

// Add a category (feature is 512-dim; pass null to generate a placeholder feature)
boolean ok  = clipHelper.addTextCategory("Braised pork", false, feature); // positive sample
boolean ok2 = clipHelper.addTextCategory("Plate", true, null);           // exclusion

// Delete / toggle exclusion state
clipHelper.removeCategory("Braised pork");
clipHelper.toggleExcludeStatus("Plate");   // positive <-> exclusion

// Query
Map<String, Boolean> all   = clipHelper.getAllCategories();   // label -> isExclude
Map<String, Boolean> pos   = clipHelper.getPositiveCategories();
Map<String, Boolean> map   = clipHelper.getCategoryMap();
List<String> excludes      = clipHelper.getExcludeList();
boolean isExclude          = clipHelper.isExclude("Plate");
float[] feat               = clipHelper.getFeature("Braised pork");
int count                  = clipHelper.getCategoryCount();
float[] placeholder        = clipHelper.generatePlaceholderFeature("New category");
MethodDescription
addTextCategory(String label, boolean isExclude, float[] feature)Adds a category; isExclude=true marks it as an exclusion.
removeCategory(String label)Deletes a category.
toggleExcludeStatus(String label)Switches between positive sample and exclusion.
getAllCategories() / getPositiveCategories() / getCategoryMap()All / positive-only / category map (label -> excluded).
getExcludeList() / isExclude(String)Exclusion list / whether a label is an exclusion.
getFeature(String label) / getCategoryCount()Category feature / total category count.

4.5 Persistence and local loading

// Write locally: filesDir/text_features.bin + categories.json
clipHelper.saveFeaturesToFile();

// Load / refresh from local files
clipHelper.loadCategoriesFromFiles();
clipHelper.refreshCategoriesFromFiles();
clipHelper.forceReloadFeatures();
clipHelper.reloadFeatures();

4.6 Threshold and stabilization

float threshold = clipHelper.getThreshold();   // Default 0.6
clipHelper.setThreshold(0.65f);                // Range 0.3 ~ 0.9

clipHelper.clearStableCache(trackId);          // Clear the stability cache for one target
clipHelper.clearAllStableCache();              // Clear all stability caches

4.7 Release

clipHelper.release();   // Releases the image model and stability cache (call resetInstance to null the singleton)

5. YOLO Object Detection (InferenceWrapper)

Prerequisite: activation completed. When not activated, initModelFromAssets() throws LicenseNotActivatedException and the model is not loaded.

The YOLO model best.rknn is bundled in the AAR and supports two initialization approaches. Singleton.

5.1 Initialization

Option 1 (recommended): load from the AAR assets

import com.rockchip.gpadc.demo.yolo.InferenceWrapper;

InferenceWrapper yolo = InferenceWrapper.getInstance();
// Automatically copies assets/best.rknn to the cache and initializes
yolo.initModelFromAssets(context, 640, 640, 3);
boolean ready = yolo.isInitialized();

Option 2: host supplies a custom model path

InferenceWrapper yolo = InferenceWrapper.getInstance();
yolo.initModel(640, 640, 3, "/data/user/0/" + context.getPackageName() + "/files/best.rknn");
initModelFromAssets(Context, im_height, im_width, im_channel): automatically copies best.rknn to context.getCacheDir()/best.rknn and reuses it when the cached file already exists and is larger than 1 MB; then calls initModel() to finish NPU initialization. Returns 0 on success and non-zero on failure; throws LicenseNotActivatedException when not activated.

5.2 Inference

run takes an NPU image buffer handle (from ImageBufferQueue) and returns the raw outputs of the three grid scales:

ImageBufferQueue queue = new ImageBufferQueue(3, previewW, previewH);
ImageBufferQueue.ImageBuffer buf = queue.getFreeBuffer();
// ... convert the camera frame through RGA into the NPU buffer (see section 8)
InferenceResult.OutputBuffer out = yolo.run(buf.mImage_handle, previewW, previewH);

5.3 Post-processing

ArrayList<InferenceResult.Recognition> list = yolo.postProcess(out);

5.4 Release

yolo.deinit();

6. Inference Result Containers (InferenceResult)

6.1 Recognition

MethodDescription
int getId()Class id
Float getConfidence()Confidence (0–1)
RectF getLocation()Normalized target box (0–1, returns a copy)
int getTrackId()Track id
void setLocation(RectF) / void setTrackId(int)Set coordinates / track id

6.2 OutputBuffer

FieldTypeDescription
mGrid0Out / mGrid1Out / mGrid2Outbyte[]Raw outputs of the three YOLO scales
floatOutputfloat[]CLIP image feature output (512-dim)

6.3 DetectResultGroup

Grouped result container with fields: count, ids[], scores[], boxes[].

6.4 DetectionResult (Parcelable, cross-process)

FieldTypeDescription
idintClass id
confidencefloatConfidence
left / top / right / bottomfloatNormalized coordinates
trackIdintTrack id
labelStringCategory name

7. Object Tracking (ObjectTracker)

import com.rockchip.gpadc.demo.tracker.ObjectTracker;

ObjectTracker tracker = new ObjectTracker(previewWidth, previewHeight, maxTrackLifetime /* e.g. 4 */);
ArrayList<InferenceResult.Recognition> tracked = tracker.tracker(recognitions);
// Each returned Recognition carries a trackId and normalized coordinates
MethodDescription
ObjectTracker(int width, int height, int maxTrackLifetime)Constructor: preview width/height and maximum number of frames a track survives.
ArrayList<Recognition> tracker(ArrayList<Recognition> recognitions)Assigns/continues track ids for detections and returns them.

8. NPU Image Buffers (ImageBufferQueue)

Allocates/reuses NPU image buffers (targets of RGA conversion).

ImageBufferQueue queue = new ImageBufferQueue(3, width, height);
ImageBufferQueue.ImageBuffer buf = queue.getFreeBuffer();   // Take a free buffer
queue.postBuffer(buf);                                      // Mark ready after filling
ImageBufferQueue.ImageBuffer ready = queue.getReadyBuffer(); // Take a ready buffer for inference
queue.releaseBuffer(ready);                                 // Release after use
queue.release();                                            // Release everything (onDestroy)
Method / fieldDescription
static boolean isNPUAvailable()Whether the NPU is available (static).
boolean isNpuAvailable()Instance-level NPU availability check.
ImageBuffer getFreeBuffer()Takes a free buffer.
void postBuffer(ImageBuffer)Marks a filled buffer as ready.
ImageBuffer getReadyBuffer()Takes a ready buffer.
void releaseBuffer(ImageBuffer)Returns a single buffer.
void release()Releases all buffers.
ImageBuffer.mImage_handleNPU buffer handle (passed to InferenceWrapper.run / RGA.colorConvertAndFlip).
ImageBuffer.mStatus / mWidth / mHeight / mBufferSizeStatus / width / height / buffer size.

9. RGA Color Conversion (RGA / HALDefine)

import com.rockchip.gpadc.demo.rga.RGA;
import static com.rockchip.gpadc.demo.rga.HALDefine.*;

// Convert an NV21/RGBA camera frame into the NPU buffer, optionally flipping horizontally
int ret = RGA.colorConvertAndFlip(srcBytes, RK_FORMAT_YCrCb_420_SP,
        npuBuffer.mImage_handle, RK_FORMAT_RGB_888, width, height, IM_HAL_TRANSFORM_FLIP_H);
// Returns 0 on success

RGA.colorConvertAndFlip(byte[] src, int srcFmt, long npuBufHandle, int dstFmt, int w, int h, int flip) is a static method.

Common format constants (HALDefine):

ConstantDescription
RK_FORMAT_RGBA_8888RGBA
RK_FORMAT_RGB_888RGB
RK_FORMAT_YCrCb_420_SPNV21
IM_HAL_TRANSFORM_FLIP_HHorizontal flip

10. Low-level CLIP Wrapper (ClipInferenceWrapper)

The high-level ClipHelper already wraps the common flow; to call the low-level RKNN models directly, use:

MethodDescription
boolean initModel(int h, int w, int c, String modelPath)Initializes the CLIP image model.
InferenceResult.OutputBuffer runRawRgb(byte[] rgbData, int w, int h)Runs image inference on RGB data.
void deinitImage()Releases the image model.
boolean initTextModel(int seqLen, String modelPath)Initializes the text model (normally unused; the precomputed text_features.bin is used by default).
float[] runTextToken(int[] tokenIds, int[] attnMask)Text token inference.
void deinitText()Releases the text model.

11. Complete Example (YOLO detection + CLIP recognition)

public class Demo {
    private InferenceWrapper mYolo;
    private ClipHelper mClip;
    private ImageBufferQueue mQueue;
    private ObjectTracker mTracker;

    public void init(Context context) {
        // 0. Confirm activation (otherwise the following initializations are gated)
        if (!LicenseManager.isActivated(context)) {
            throw new IllegalStateException("Not activated; complete activation first");
        }

        // 1. Initialize YOLO (load best.rknn from the bundled assets)
        mYolo = InferenceWrapper.getInstance();
        mYolo.initModelFromAssets(context, 640, 640, 3);

        // 2. Initialize CLIP (the singleton loads the bundled model and features)
        mClip = ClipHelper.getInstance(context);

        // 3. NPU buffers and tracker
        mQueue = new ImageBufferQueue(3, 1024, 768);
        mTracker = new ObjectTracker(1024, 768, 4);
    }

    public void onFrame(byte[] nv21, int w, int h) {
        // 4. Color conversion into the NPU buffer
        ImageBufferQueue.ImageBuffer buf = mQueue.getFreeBuffer();
        RGA.colorConvertAndFlip(nv21, HALDefine.RK_FORMAT_YCrCb_420_SP,
                buf.mImage_handle, HALDefine.RK_FORMAT_RGB_888, w, h, 0);
        mQueue.postBuffer(buf);

        // 5. YOLO inference + post-processing
        InferenceResult.OutputBuffer out = mYolo.run(buf.mImage_handle, w, h);
        ArrayList<InferenceResult.Recognition> dets = mYolo.postProcess(out);

        // 6. Object tracking
        dets = mTracker.tracker(dets);

        // 7. Run CLIP recognition on each detection box
        for (InferenceResult.Recognition r : dets) {
            RectF loc = r.getLocation();                       // Normalized coordinates
            Bitmap crop = cropFromPreview(loc, w, h);          // Crop from the frame (implement yourself)
            ClipHelper.Result cls = mClip.clipClassify(crop, loc, r.getTrackId());
            if (cls != null && !cls.isNegative) {              // Filter exclusions / low confidence
                Log.d("DEMO", "Detected: " + cls.clsName + " score=" + cls.score);
            }
        }
    }

    public void onDestroy() {
        if (mQueue != null) mQueue.release();
        if (mYolo != null) mYolo.deinit();
        if (mClip != null) mClip.release();
    }
}

12. Project Layout and Rebuilding

sdk/
├── build.gradle            # Library module (namespace: com.rockchip.gpadc.demo, depends on gson only)
├── CMakeLists.txt          # Builds librknn4j.so (C++ sources)
├── proguard-rules.pro
└── src/main/
    ├── AndroidManifest.xml  # CAMERA + storage permissions only (no network permissions)
    ├── assets/              # best.rknn + clip_vision_finetuned.rknn + labels + features + tokenizer
    ├── cpp/                 # native-lib / post_process / yolo_image / object_tracker / rga
    ├── jniLibs/arm64-v8a/   # librknnrt.so / librga.so / libopencv_java3.so / librknn4j.so
    └── java/com/rockchip/gpadc/demo/
        ├── ClipHelper.java
        ├── ImageBufferQueue.java
        ├── InferenceResult.java
        ├── DetectionResult.java
        ├── clip/ClipInferenceWrapper.java
        ├── yolo/InferenceWrapper.java
        ├── yolo/PostProcess.java
        ├── tracker/ObjectTracker.java
        ├── rga/RGA.java
        ├── rga/HALDefine.java
        └── license/LicenseManager.java

Rebuild command (in the project root; requires JDK 17 + Android SDK with the NDK toolchain available):

gradlew.bat :sdk:assembleRelease
# Output: sdk/build/outputs/aar/sdk-release.aar

13. Known Limitations and Notes

  1. AAR size: about 169 MB (CLIP model + YOLO model + OpenCV). To slim it down, consider removing clip_vision_finetuned.rknn (keeping YOLO only).
  2. Hardware dependency: must run on an RKNN platform (arm64-v8a); ordinary emulators have no NPU.
  3. CLIP text model: ClipInferenceWrapper keeps both image and text model interfaces, but ClipHelper uses the precomputed text feature file (text_features.bin) by default and does not need to load the text model on-device.
  4. Source of category features: on first use, ensure text_features.bin and categories.json exist in the files/ directory; they can be generated locally by the SDK's saveFeaturesToFile().
  5. YOLO model: best.rknn is bundled and loads with one call to initModelFromAssets(); to replace it, pass an external path to initModel(). The model is single-class (food) and post-processing is compiled for OBJ_CLASS_NUM=1; do not substitute a COCO 80-class model.
  6. Exclusion filtering: results matching an exclusion have Result.isNegative=true and clsName=null; the host UI should filter them out, drawing no box and adding nothing to the normal result list.
  7. Offline behavior: this release makes no network requests; category features, sample images and verification records stay on the device. Clearing app data or switching devices requires re-collection / re-activation.
  8. Obfuscation: the AAR ships with proguard-rules.pro that keeps JNI and data entity classes. If the host app is obfuscated, make sure these keep rules are preserved.