-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
126 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
set OBJECT_DETECTION_PATH=C:\devsbb\projekte\tf-models\research | ||
set PROJECT_PATH=%CD% | ||
set CKPT_NO=16579 | ||
set ASDF=c:\my\paths | ||
set TEST=%ASDF% | ||
echo ">>>>>> Cleaning saved model... <<<<<<" | ||
del /S %PROJECT_PATH%\object_detection\saved_model | ||
echo ">>>>>> Exporting saved model... <<<<<<" | ||
python3 %OBJECT_DETECTION_PATH%\object_detection\export_inference_graph.py --input_type=image_tensor --pipeline_config_path=%PROJECT_PATH%\object_detection\faster_rcnn_inception_v2_coco_2018_01_28\pipeline.config --trained_checkpoint_prefix=%PROJECT_PATH%\object_detection\training\model.ckpt-%CKPT_NO% --output_directory=%PROJECT_PATH%\object_detection\saved_model | ||
echo ">>>>>> Converting saved model to tfjs... <<<<<<" | ||
tensorflowjs_converter --input_format=tf_saved_model --output_format=tensorflowjs --saved_model_tags=serve --output_json=true --output_node_names=detection_boxes,detection_classes,detection_features,detection_multiclass_scores,detection_scores,num_detections,raw_detection_boxes,raw_detection_scores %PROJECT_PATH%\object_detection\saved_model\saved_model %PROJECT_PATH%\src\assets\web_model |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/bash | ||
|
||
set -e | ||
|
||
OBJECT_DETECTION_PATH='C:\devsbb\projekte\\tf-models\\research' | ||
PROJECT_PATH=. | ||
CKPT_NO=16579 | ||
|
||
ASDF=/c/my/paths | ||
TEST=$ASDF | ||
|
||
echo ">>>>>> Cleaning saved model... <<<<<<" | ||
|
||
rm -rf ${PROJECT_PATH}/object_detection/saved_model | ||
|
||
echo ">>>>>> Exporting saved model... <<<<<<" | ||
|
||
python3 ${OBJECT_DETECTION_PATH}/object_detection/export_inference_graph.py \ | ||
--input_type=image_tensor \ | ||
--pipeline_config_path=${PROJECT_PATH}/object_detection/faster_rcnn_inception_v2_coco_2018_01_28/pipeline.config \ | ||
--trained_checkpoint_prefix=${PROJECT_PATH}/object_detection/training/model.ckpt-${CKPT_NO} \ | ||
--output_directory=${PROJECT_PATH}/object_detection/saved_model | ||
|
||
echo ">>>>>> Converting saved model to tfjs... <<<<<<" | ||
|
||
# tensorflowjs_converter 0.8.6: | ||
|
||
tensorflowjs_converter \ | ||
--input_format=tf_saved_model \ | ||
--output_format=tensorflowjs\ | ||
--saved_model_tags=serve \ | ||
--output_json=true \ | ||
--output_node_names='detection_boxes,detection_classes,detection_features,detection_multiclass_scores,detection_scores,num_detections,raw_detection_boxes,raw_detection_scores' \ | ||
${PROJECT_PATH}/object_detection/saved_model/saved_model \ | ||
${PROJECT_PATH}/src/assets/web_model |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export interface CommandHandler { | ||
handle(command: any): string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import {CommandHandler} from './command-handler'; | ||
import {splitParams} from './util'; | ||
|
||
export class CpHandler implements CommandHandler { | ||
|
||
constructor(private defaultHandler: (command: any) => string) { | ||
} | ||
|
||
handle(command: any): string { | ||
const {singleDashParams, doubleDashParams, argList} = splitParams(command); | ||
const winParams: string[] = []; | ||
singleDashParams.forEach(suffix => { | ||
if (suffix.text.indexOf('d') >= 0) { | ||
winParams.push('/L') | ||
} | ||
}); | ||
return `copy ${winParams.join(' ')} ${argList.map(this.defaultHandler).join(' ')}`; // converting assures paths are fixed.. | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import {CommandHandler} from './command-handler'; | ||
import {splitParams} from './util'; | ||
|
||
export class RmHandler implements CommandHandler { | ||
|
||
constructor(private defaultHandler: (command: any) => string) { | ||
} | ||
|
||
handle(command: any): string { | ||
const {singleDashParams, doubleDashParams, argList} = splitParams(command); | ||
const winParams: string[] = []; | ||
singleDashParams.forEach(suffix => { | ||
if (suffix.text.indexOf('r') >= 0) { | ||
winParams.push('/S') | ||
} | ||
}); | ||
return `del ${winParams.join(' ')} ${argList.map(this.defaultHandler).join(' ')}`; // converting assures paths are fixed.. | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export function splitParams(command: any) { | ||
const singleDashParamMatcher = /^-\w+$/i; | ||
const doubleDashParamMatcher = /^--\w+/i; | ||
const singleDashParams: any[] = (command.suffix || []).filter((s: any) => s.text.match(singleDashParamMatcher)); | ||
const doubleDashParams: any[] = (command.suffix || []).filter((s: any) => s.text.match(doubleDashParamMatcher)); | ||
const argList: any[] = (command.suffix || []).filter((s: any) => !s.text.match(singleDashParamMatcher) && !s.text.match(doubleDashParamMatcher)); | ||
return {singleDashParams, doubleDashParams, argList}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
File renamed without changes.