Skip to content

Commit

Permalink
Merge pull request #67 from openvinotoolkit/rhecker/general_fixes
Browse files Browse the repository at this point in the history
General fixes & OpenVINO 24.6 RC3
  • Loading branch information
RHeckerIntel authored Dec 18, 2024
2 parents 64e0aab + 72f8f0b commit 75d6b09
Show file tree
Hide file tree
Showing 27 changed files with 290 additions and 200 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/windows-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ jobs:
C:\vcpkg\vcpkg install
# Step 10: Download and Install OpenVINO Runtime
- name: Download and Install OpenVINO Runtime 24.5.0
- name: Download and Install OpenVINO Runtime 24.6.0
shell: powershell
run: |
Invoke-WebRequest -Uri https://storage.openvinotoolkit.org/repositories/openvino_genai/packages/nightly/2025.0.0.0.dev20241105/openvino_genai_windows_2025.0.0.0.dev20241105_x86_64.zip -OutFile openvino_runtime.zip
Invoke-WebRequest -Uri https://storage.openvinotoolkit.org/repositories/openvino_genai/packages/pre-release/2024.6.0.0rc3/openvino_genai_windows_2024.6.0.0rc3_x86_64.zip -OutFile openvino_runtime.zip
Expand-Archive -Path openvino_runtime.zip -DestinationPath C:/Intel/
Rename-Item -Path "C:/Intel/openvino_genai_windows_2025.0.0.0.dev20241105_x86_64" -NewName "openvino_2024.5.0"
dir C:/Intel/openvino_2024.5.0/
Rename-Item -Path "C:/Intel/openvino_genai_windows_2024.6.0.0rc3_x86_64" -NewName "openvino_2024.6.0_rc3"
dir C:/Intel/openvino_2024.6.0_rc3/
# Step 11: Install Mediapipe Requirements
- name: Install Mediapipe Requirements
Expand Down
25 changes: 18 additions & 7 deletions assets/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,29 @@
"collection": "speech-to-text-672321d5c070537a178a8aeb"
},
{
"name": "Open_llama_3b_v2",
"id": "open_llama_3b_v2-int8-ov",
"fileSize": 3689232204,
"optimizationPrecision": "int8",
"contextWindow": 2048,
"description": "Chat with Open_llama_3b_v2",
"task": "text-generation",
"name": "LCM Dreamshaper v7 fp16",
"id": "LCM_Dreamshaper_v7-fp16-ov",
"fileSize": 4275284513,
"optimizationPrecision": "fp16",
"contextWindow": 0,
"description": "Generate images with Dreamshaper V7",
"task": "text-to-image",
"author": "OpenVINO",
"collection": "llm-6687aaa2abca3bbcec71a9bd"
}
],
"all_models": [
{
"name": "LCM Dreamshaper v7 fp16",
"id": "LCM_Dreamshaper_v7-fp16-ov",
"fileSize": 4275284513,
"optimizationPrecision": "fp16",
"contextWindow": 0,
"description": "Generate images with Dreamshaper V7",
"task": "text-to-image",
"author": "OpenVINO",
"collection": ""
},
{
"name": "Whisper Tiny",
"id": "whisper-tiny-int4-ov",
Expand Down
22 changes: 19 additions & 3 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright 2024 Intel Corporation.
// SPDX-License-Identifier: Apache-2.0
import 'dart:io';

import 'package:dio/dio.dart';
import 'package:fluent_ui/fluent_ui.dart';
Expand All @@ -10,12 +11,12 @@ import 'package:inference/providers/preference_provider.dart';
import 'package:inference/providers/project_provider.dart';
import 'package:inference/public_models.dart';
import 'package:provider/provider.dart';

import 'package:window_manager/window_manager.dart';

const String title = 'OpenVINO TestDrive';

void testConnection() async {
final dio = Dio(BaseOptions(connectTimeout: Duration(seconds: 10)));
final dio = Dio(BaseOptions(connectTimeout: const Duration(seconds: 10)));

try {
await dio.get(collections[0].path);
Expand All @@ -27,8 +28,23 @@ void testConnection() async {
}
}

void main() {
void main() async {
WidgetsFlutterBinding.ensureInitialized();
testConnection();
await windowManager.ensureInitialized();

WindowOptions windowOptions = WindowOptions(
size: const Size(1400, 1024),
center: true,
backgroundColor: Colors.transparent,
skipTaskbar: false,
titleBarStyle: TitleBarStyle.hidden,
windowButtonVisibility: Platform.isMacOS,
);
windowManager.waitUntilReadyToShow(windowOptions, () async {
await windowManager.show();
await windowManager.focus();
});
runApp(const App());
}

Expand Down
54 changes: 53 additions & 1 deletion lib/openvino_console_app.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright 2024 Intel Corporation.
// SPDX-License-Identifier: Apache-2.0
import 'dart:io';

import 'package:go_router/go_router.dart';
import 'package:inference/deployment_processor.dart';
Expand All @@ -12,6 +13,7 @@ import 'package:inference/utils.dart';
import 'package:inference/widgets/feedback_button.dart';
import 'package:provider/provider.dart';
import 'package:fluent_ui/fluent_ui.dart';
import 'package:window_manager/window_manager.dart';


class OpenVINOTestDriveApp extends StatefulWidget {
Expand All @@ -32,7 +34,6 @@ class OpenVINOTestDriveApp extends StatefulWidget {
class _OpenVINOTestDriveAppState extends State<OpenVINOTestDriveApp> {
@override
void initState() {
//NOTE: Do we need to add listeneres to windowManager here?
super.initState();

//setLoggingOutput();
Expand Down Expand Up @@ -134,6 +135,39 @@ class _OpenVINOTestDriveAppState extends State<OpenVINOTestDriveApp> {
appBar: NavigationAppBar(
leading: Container(),
height: 48,
actions: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTapDown: (_) => windowManager.startDragging(),
child: SizedBox(
height: 48,
child: Align(
alignment: Alignment.centerLeft,
child: Padding(
padding: EdgeInsets.only(left: Platform.isMacOS ? 60 : 5),
child: Row(
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: ClipRRect(
borderRadius: BorderRadius.circular(50.0),
child: Image.asset('images/logo_50.png', width: 20, height: 20)
),
),
const Text("OpenVINO™ Test Drive"),
],
),
),
),
),
),
),
(Platform.isMacOS ? Container() : const WindowButtons()),
]
)
),
paneBodyBuilder: (item, child) {
final name =
Expand All @@ -160,3 +194,21 @@ class _OpenVINOTestDriveAppState extends State<OpenVINOTestDriveApp> {
);
}
}

class WindowButtons extends StatelessWidget {
const WindowButtons({super.key});

@override
Widget build(BuildContext context) {
final FluentThemeData theme = FluentTheme.of(context);

return SizedBox(
width: 138,
height: 50,
child: WindowCaption(
brightness: theme.brightness,
backgroundColor: Colors.transparent,
),
);
}
}
17 changes: 3 additions & 14 deletions lib/pages/computer_vision/computer_vision.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import 'package:inference/project.dart';
import 'package:inference/providers/image_inference_provider.dart';
import 'package:inference/providers/preference_provider.dart';
import 'package:inference/utils.dart';
import 'package:inference/widgets/controls/close_model_button.dart';
import 'package:provider/provider.dart';

class ComputerVisionPage extends StatefulWidget {
Expand Down Expand Up @@ -106,7 +107,7 @@ class _ComputerVisionPageState extends State<ComputerVisionPage> {
Padding(
padding: const EdgeInsets.all(4),
child: FilledButton(
child: const Text("Download"),
child: const Text("Export model"),
onPressed: () => downloadProject(widget.project),
),
),
Expand All @@ -117,19 +118,7 @@ class _ComputerVisionPageState extends State<ComputerVisionPage> {
// onPressed: () => print("close")
// ),
//),
Padding(
padding: const EdgeInsets.all(4),
child: OutlinedButton(
style: ButtonStyle(
shape:WidgetStatePropertyAll(RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
side: const BorderSide(color: Color(0XFF545454)),
)),
),
child: const Text("Close"),
onPressed: () => GoRouter.of(context).go("/models"),
),
),
const CloseModelButton(),
]
),
),
Expand Down
32 changes: 28 additions & 4 deletions lib/pages/download_model/download_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ class _DownloadModelPageState extends State<DownloadModelPage> {
projectProvider.addProject(widget.project);
await getAdditionalModelInfo(widget.project);
projectProvider.completeLoading(widget.project);
router.go("/models/inference", extra: widget.project);
router.pushReplacement("/models/inference", extra: widget.project);
} catch(e) {
print(e);
if (mounted) {
await showDialog(context: context, builder: (BuildContext context) => ContentDialog(
title: Text('An error occurred trying to download ${widget.project.name}'),
Expand All @@ -95,6 +96,28 @@ class _DownloadModelPageState extends State<DownloadModelPage> {
}
}

Future<void> onClose() async {
final result = await showDialog<bool>(context: context, builder: (BuildContext context) => ContentDialog(
title: const Text("Download in progress"),
content: const Text("Press 'continue' to keep downloading the model"),
actions: <Widget>[
FilledButton(
onPressed: () => context.pop(false),
child: const Text('Continue'),
),
Button(
onPressed: () => context.pop(true),
child: const Text('Cancel download'),
),
]
)
);

if (result == true && context.mounted) {
GoRouter.of(context).pop();
}
}

@override
Widget build(BuildContext context) {
final theme = FluentTheme.of(context);
Expand Down Expand Up @@ -140,9 +163,10 @@ class _DownloadModelPageState extends State<DownloadModelPage> {
),
],
),
Button(child: const Text("Close"), onPressed: () {
GoRouter.of(context).canPop() ? GoRouter.of(context).pop() : GoRouter.of(context).go('/home');
}),
Button(
onPressed: onClose,
child: const Text("Close")
),
],
),
),
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/home/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ class _HomePageState extends State<HomePage> {

void downloadFeaturedModel(Model model){
model.convertToProject().then((project) {
GoRouter.of(context).go('/models/download', extra: project);
GoRouter.of(context).push('/models/download', extra: project);
});

}
void openFeaturedModel(Model model){
var project = getProjectWithModel(model);
if (project != null){
GoRouter.of(context).go("/models/inference", extra: project);
GoRouter.of(context).push("/models/inference", extra: project);
}
}

Expand Down
Loading

0 comments on commit 75d6b09

Please sign in to comment.