Skip to content

Commit

Permalink
update => net6.0, added support for GpuMemortPointer & optimze the me…
Browse files Browse the repository at this point in the history
…mory leakage
  • Loading branch information
maalik0786 committed Jan 24, 2022
1 parent bd1db79 commit 60b259d
Show file tree
Hide file tree
Showing 33 changed files with 2,116 additions and 795 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -376,3 +376,4 @@ FastYolo.Tests/libdarknet_arm.so
FastYolo.Tests/libopencv_world_arm.so
FastYolo.Tests/libpthread_arm.so
*.so
*.txt
7 changes: 5 additions & 2 deletions FastYolo.TestApp/FastYolo.TestApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<PlatformTarget>AnyCPU</PlatformTarget>
<ImplicitUsings>enable</ImplicitUsings>
<StartupObject>FastYolo.TestApp.Program</StartupObject>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\FastYolo.Tests\FastYolo.Tests.csproj" />
<ProjectReference Include="..\FastYolo.Tests\FastYolo.Tests.csproj" />
</ItemGroup>
</Project>
26 changes: 11 additions & 15 deletions FastYolo.TestApp/Program.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
using System;
using FastYolo.Tests;
using FastYolo.Tests;

namespace FastYolo.TestApp
namespace FastYolo.TestApp;

public class Program
{
public class Program
//ncrunch: no coverage start
public static void Main()
{
//ncrunch: no coverage start
public static void Main()
{
using var yoloWrapper = new YoloWrapper(YoloConfigurationTests.YoloConfigFilename,
YoloConfigurationTests.YoloWeightsFilename,
YoloConfigurationTests.YoloClassesFilename);
var yoloItems = yoloWrapper.Detect(YoloConfigurationTests.DummyImageFilename);
foreach (var item in yoloItems)
Console.WriteLine("Found " + item.Type + " " + item.X + "," + item.Y);
Console.WriteLine("LoadDummyImageForObjectDetection() Done\n");
}
using var yoloWrapper = new YoloWrapper(YoloConfigurationTests.YoloConfigFilename,
YoloConfigurationTests.YoloWeightsFilename, YoloConfigurationTests.YoloClassesFilename);
var yoloItems = yoloWrapper.Detect(YoloConfigurationTests.ImageFilename);
foreach (var item in yoloItems)
Console.WriteLine("Found " + item.Type + " " + item.X + "," + item.Y);
}
}
29 changes: 29 additions & 0 deletions FastYolo.TestApp/yolo_cpp_dll.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30204.135
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yolo_cpp_dll", "yolo_cpp_dll.vcxproj", "{4CF5694F-12A5-4012-8D94-9A0915E9FEB5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4CF5694F-12A5-4012-8D94-9A0915E9FEB5}.Debug|x64.ActiveCfg = Debug|x64
{4CF5694F-12A5-4012-8D94-9A0915E9FEB5}.Debug|x64.Build.0 = Debug|x64
{4CF5694F-12A5-4012-8D94-9A0915E9FEB5}.Debug|x86.ActiveCfg = Debug|x64
{4CF5694F-12A5-4012-8D94-9A0915E9FEB5}.Release|x64.ActiveCfg = Release|x64
{4CF5694F-12A5-4012-8D94-9A0915E9FEB5}.Release|x64.Build.0 = Release|x64
{4CF5694F-12A5-4012-8D94-9A0915E9FEB5}.Release|x86.ActiveCfg = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {48B51309-F4EE-4EA4-8438-DB05D81DAF94}
EndGlobalSection
EndGlobal
341 changes: 341 additions & 0 deletions FastYolo.TestApp/yolo_cpp_dll.vcxproj

Large diffs are not rendered by default.

Binary file added FastYolo.Tests/Assets/cars road.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
80 changes: 80 additions & 0 deletions FastYolo.Tests/Assets/coco.names
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
person
bicycle
car
motorbike
aeroplane
bus
train
truck
boat
traffic light
fire hydrant
stop sign
parking meter
bench
bird
cat
dog
horse
sheep
cow
elephant
bear
zebra
giraffe
backpack
umbrella
handbag
tie
suitcase
frisbee
skis
snowboard
sports ball
kite
baseball bat
baseball glove
skateboard
surfboard
tennis racket
bottle
wine glass
cup
fork
knife
spoon
bowl
banana
apple
sandwich
orange
broccoli
carrot
hot dog
pizza
donut
cake
chair
sofa
pottedplant
bed
diningtable
toilet
tvmonitor
laptop
mouse
remote
keyboard
cell phone
microwave
oven
toaster
sink
refrigerator
book
clock
vase
scissors
teddy bear
hair drier
toothbrush
182 changes: 182 additions & 0 deletions FastYolo.Tests/Assets/yolov3-tiny.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
[net]
# Testing
batch=1
subdivisions=1
# Training
# batch=64
# subdivisions=2
width=416
height=416
channels=3
momentum=0.9
decay=0.0005
angle=0
saturation = 1.5
exposure = 1.5
hue=.1

learning_rate=0.001
burn_in=1000
max_batches = 500200
policy=steps
steps=400000,450000
scales=.1,.1

[convolutional]
batch_normalize=1
filters=16
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=32
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=64
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=128
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=256
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=2

[convolutional]
batch_normalize=1
filters=512
size=3
stride=1
pad=1
activation=leaky

[maxpool]
size=2
stride=1

[convolutional]
batch_normalize=1
filters=1024
size=3
stride=1
pad=1
activation=leaky

###########

[convolutional]
batch_normalize=1
filters=256
size=1
stride=1
pad=1
activation=leaky

[convolutional]
batch_normalize=1
filters=512
size=3
stride=1
pad=1
activation=leaky

[convolutional]
size=1
stride=1
pad=1
filters=255
activation=linear



[yolo]
mask = 3,4,5
anchors = 10,14, 23,27, 37,58, 81,82, 135,169, 344,319
classes=80
num=6
jitter=.3
ignore_thresh = .7
truth_thresh = 1
random=1

[route]
layers = -4

[convolutional]
batch_normalize=1
filters=128
size=1
stride=1
pad=1
activation=leaky

[upsample]
stride=2

[route]
layers = -1, 8

[convolutional]
batch_normalize=1
filters=256
size=3
stride=1
pad=1
activation=leaky

[convolutional]
size=1
stride=1
pad=1
filters=255
activation=linear

[yolo]
mask = 0,1,2
anchors = 10,14, 23,27, 37,58, 81,82, 135,169, 344,319
classes=80
num=6
jitter=.3
ignore_thresh = .7
truth_thresh = 1
random=1
Loading

0 comments on commit 60b259d

Please sign in to comment.